Attachment 'lecture8_ifexample.py'
Download 1 #!/usr/bin/python
2
3 from Tkinter import *
4
5 def Check():
6 input = ent.get()
7
8 if input == 'pass' or input == 'hi' :
9 print 'COrrect password'
10 elif input == 'passe':
11 print 'Close but not it'
12 else:
13 print 'wrong wrong wrong'
14
15 ent.delete(0,END)
16 ent.focus()
17
18
19
20
21
22 root = Tk()
23
24 ent = Entry(root, bg = 'white')
25 button = Button(root, text = 'Press', command = Check)
26
27 ent.pack(anchor = W)
28 button.pack(anchor = E)
29
30 ent.focus()
31
32 root.mainloop()
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.