Attachment 'Lecture3_example2.py'
Download
Toggle line numbers
1 #!/usr/bin/python
2
3 from Tkinter import * #Importing the library (tool box)
4
5
6
7 root = Tk() #Creating a background window
8
9 li = ['Carl','Patrick','Lindsay','Helmut','Chris','Gwen']
10 #Creating a list
11
12 movie = ['God Father','Beauty and the Beast','Brave heart']
13
14 listb = Listbox(root) # Creating a listbox widget
15 listb2 = Listbox(root)
16
17 for item in li: # Insert each item inside li into the listb
18 listb.insert(0,item)
19 for item in movie:
20 listb2.insert(0,item)
21
22 listb.pack() # Pack listb into the main window
23 listb2.pack()
24
25 root.mainloop() # Go into the loopback
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.