Attachment 'Lecture3_example1.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
13 listb = Listbox(root) # Creating a listbox widget
14
15 for item in li: # Insert each item inside li into the listb
16 listb.insert(0,item)
17
18 listb.pack() # Pack listb into the main window
19
20 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.