0% found this document useful (0 votes)
5 views

User Interface - Colaboratory

Uploaded by

Janner Pareja
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

User Interface - Colaboratory

Uploaded by

Janner Pareja
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

22/11/2020 User Interface.

ipynb - Colaboratory

USER INTERFACE IN PYTHON (Jupyter)

class Python:

def myApp:

#here my code..

Author: Janner Pareja Gutiérrez

Date: 22 nov. 2020

User interface in python (Terminal)

https://colab.research.google.com/drive/1WiBvWgjLfV4UZouf-6Eg00cleOidYBrg#scrollTo=lKrVjg8owg6-&printMode=true 1/5
22/11/2020 User Interface.ipynb - Colaboratory

User Interface

In the industrial design eld of human-computer interaction, a user interface (UI) is the space
where interactions between humans and machines occur. The goal of this interaction is to allow
effective operation and control of the machine from the human end, whilst the machine
simultaneously feeds back information that aids the operators' decision-making process.
Examples of this broad concept of user interfaces include the interactive aspects of computer
operating systems, hand tools, heavy machinery operator controls, and process controls. The
design considerations applicable when creating user interfaces are related to, or involve such
disciplines as, ergonomics and psychology.

Generally, the goal of user interface design is to produce a user interface which makes it easy,
e cient, and enjoyable (user-friendly) to operate a machine in the way which produces the desired
result (i.e. maximum usability). This generally means that the operator needs to provide minimal
input to achieve the desired output, and also that the machine minimizes undesired outputs to the
user.

User interfaces are composed of one or more layers, including a human-machine interface (HMI)
that interfaces machines with physical input hardware such as keyboards, mice, or game pads, and
output hardware such as computer monitors, speakers, and printers. A device that implements an
HMI is called a human interface device (HID). Other terms for human-machine interfaces are man-
machine interface (MMI) and, when the machine in question is a computer, human-computer
interface. Additional UI layers may interact with one or more human senses, including: tactile UI
(touch), visual UI (sight), auditory UI (sound), olfactory UI (smell), equilibrial UI (balance), and
gustatory UI (taste).

https://en.wikipedia.org/wiki/User_interface

https://colab.research.google.com/drive/1WiBvWgjLfV4UZouf-6Eg00cleOidYBrg#scrollTo=lKrVjg8owg6-&printMode=true 2/5
22/11/2020 User Interface.ipynb - Colaboratory

My App

1 from google.colab import output # Get the module


2 from termcolor import colored
3
4
5 #global variables
6 user_up = ''
7 passw_up = ''
8 user = ''
9 passw = ''
10
11
12 def back():
13 print("\n")
14 back = str(input("Do you want back? (y/n): "))
15 back = back.lower()
16 if back == "y":
17 output.clear()
18 return main()
19 else:
20 output.clear()
21 quit()
22
23
24 def main():
25 global user_up, passw_up, user, passw
26
27 print("MyApp | Home | Login | Register")
28 #salto de linea
29 print("\n")
30
31 nav = str(input("Nav: Home(h) | Login(i) | Register(u): "))
32 nav = nav.lower()
33
34 if nav == 'h' or nav == 'i' or nav == 'u':
35
36 if nav == 'h':
37 home = "HOME PAGE"
38 print("\n")
39 print(home.center(50, " "))
40 contact_you = "Please, contac you with the admin!"
41 print("\n")
42 print(contact_you.center(50, " "))
43 back()
44
45 elif nav == 'i':
46 "ENTER USER DATA"
https://colab.research.google.com/drive/1WiBvWgjLfV4UZouf-6Eg00cleOidYBrg#scrollTo=lKrVjg8owg6-&printMode=true 3/5
22/11/2020 User Interface.ipynb - Colaboratory
46 msg = "ENTER USER DATA"
47 print("\n")
48 print(msg.center(50, " "))
49 print("\n")
50 user = str(input("Your User: "))
51 user = user.lower()
52 passw = str(input("Your Password: "))
53 passw = passw.lower()
54
55 if user == user_up and passw == passw_up:
56 output.clear()
57
58 print("MyApp | Home | Login | Register")
59 #salto de linea
60 print("\n")
61
62 wellcome = "WELLCOME TO MY PYTHON APP"
63 hello = "Hello " + user
64 print("\n")
65 print(wellcome.center(50, "="))
66 print("\n")
67 print(hello.center(50, " "))
68 back()
69 else:
70 print("\n")
71 print(colored('Your data is wrong!', 'red'))
72 back()
73
74 elif nav == 'u':
75 msg = "REGISTER USER"
76 print("\n")
77 print(msg.center(50, " "))
78 print("\n")
79 user_re = user_up
80 user_up = str(input("Your User: "))
81 user_up = user_up.lower()
82
83 if user_up == user_re:
84 print("\n")
85 print(colored('This user already exists!', 'red'))
86 back()
87
88 passw_up = str(input("Your Password: "))
89 passw_re = str(input("Repeat Password: "))
90
91 if passw_up != passw_re:
92 print("\n")
93 print(colored('Passwords do not match!', 'red'))
94 back()
95
96 print("\n")
97 print(colored('Registered user successfully!', 'green'))
https://colab.research.google.com/drive/1WiBvWgjLfV4UZouf-6Eg00cleOidYBrg#scrollTo=lKrVjg8owg6-&printMode=true 4/5
22/11/2020 User Interface.ipynb - Colaboratory

98 back()
99
100 elif nav != 'h' or nav != 'i' or nav != 'u':
101 error_page = "Oups! Page not found!"
102 er_404 = "404"
103 print("\n")
104 print(colored(error_page.center(50, " "), 'red'))
105 print("\n")
106 print(er_404.center(50, " "))
107 back()
108
109 main()
110

https://colab.research.google.com/drive/1WiBvWgjLfV4UZouf-6Eg00cleOidYBrg#scrollTo=lKrVjg8owg6-&printMode=true 5/5

You might also like