SFU CMPT120 Lecture 4.2-After-Large
SFU CMPT120 Lecture 4.2-After-Large
• Today
• Last Time
• Functions • Exploration Topic
• Human Computer Interaction
• Flow of Execution With Functions
• Multiple Functions • GUI development in Python
• Calling Functions Inside Functions
• Function Parameters
• Main Function
• Reading
• N/A
Humans
Design
Tasks Technology
Humans
Design
Tasks Technology
Humans
Design
Tasks Technology
8
CMPT 120, Spring 2023, Mohammad Tayebi
What is Usability?
• Ease of learning
• faster the second time and so on...
• Recall
• remember how from one session to the next
• Productivity
• perform tasks quickly and efficiently
• Minimal error rates
• if they occur, good feedback so user can recover
• High user satisfaction
• confident of success
https://www.iranpartner.com
https://dpbnri2zg3lc2.cloudfront.net
window = Tk()
lbl = Label(window, text="This is Label
widget.", fg='blue', font=("Arial", 12))
lbl.place(x=30, y=50)
window.title('Hello Python!')
window.geometry("300x200")
window.mainloop()
window = Tk()
window.title('Weight Convertor')
e1 = Label(window, text="Enter the weight in Kg")
e2_value = StringVar()
e2 = Entry(window, textvariable=e2_value)
e3 = Label(window, text='Gram')
e4 = Label(window, text='Pounds')
e5 = Label(window, text='Ounce')
t1 = Text(window, height=1, width=20)
t2 = Text(window, height=1, width=20)
t3 = Text(window, height=1, width=20)
b1 = Button(window, text="Convert", command=convert_kg)
CMPT 120, Spring 2023, Mohammad Tayebi 27
Weight Convertor: Front End - 2
e1.grid(row=0, column=0)
e2.grid(row=0, column=1)
e3.grid(row=1, column=0) grid method is used for placing
the widgets at respective
e4.grid(row=1, column=1)
positionsin table-like structure
e5.grid(row=1, column=2)
table like structure.
t1.grid(row=2, column=0)
t2.grid(row=2, column=1)
t3.grid(row=2, column=2)
b1.grid(row=0, column=2)
window.mainloop()