this is a german Web-Mirror of PYTHON.ORG powered by Domainunion AG

Attachment 'lecture4_homework.py'

Download

   1 #!/usr/bin/python
   2 
   3 from Tkinter import *   	#This interface allow us to draw windows
   4 
   5 
   6 def DrawList():
   7 	plist = ['Liz','Tom','Chi']
   8 
   9 	for item in plist:
  10 		listbox.insert(END,item);
  11 		
  12 	
  13 root = Tk()					#This creates a window, but it won't show up
  14 
  15 listbox = Listbox(root)
  16 button = Button(root,text = "press me",command = DrawList)
  17 
  18 button.pack()
  19 listbox.pack()				#this tells the listbox to come out
  20 root.mainloop()				#This command will tell the window come out

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.
  • [get | view] (2005-04-27 13:13:02, 0.6 KB) [[attachment:Lecture3_example1.py]]
  • [get | view] (2005-04-27 13:52:38, 0.7 KB) [[attachment:Lecture3_example2.py]]
  • [get | view] (2005-04-29 14:35:01, 767.5 KB) [[attachment:lecture10_pictures.py]]
  • [get | view] (2008-06-27 13:22:12, 0.0 KB) [[attachment:lecture3example1.txt]]
  • [get | view] (2005-04-28 00:44:04, 0.2 KB) [[attachment:lecture4_but.py]]
  • [get | view] (2005-04-28 00:44:35, 0.3 KB) [[attachment:lecture4_button.py]]
  • [get | view] (2005-04-28 00:44:22, 1.1 KB) [[attachment:lecture4_buttonc.py]]
  • [get | view] (2005-04-28 00:46:20, 0.4 KB) [[attachment:lecture4_first.py]]
  • [get | view] (2005-04-28 00:46:55, 0.5 KB) [[attachment:lecture4_homework.py]]
  • [get | view] (2005-04-28 00:47:56, 0.1 KB) [[attachment:lecture5_chieh.py]]
  • [get | view] (2005-04-28 00:48:10, 0.1 KB) [[attachment:lecture5_stacy.py]]
  • [get | view] (2005-04-28 00:49:57, 0.2 KB) [[attachment:lecture6_chieh.py]]
  • [get | view] (2005-04-28 00:49:43, 0.3 KB) [[attachment:lecture6_stacy.py]]
  • [get | view] (2005-04-28 00:51:59, 0.5 KB) [[attachment:lecture7_homework.py]]
  • [get | view] (2005-04-28 00:51:45, 0.4 KB) [[attachment:lecture7_text.py]]
  • [get | view] (2005-04-29 14:32:06, 0.5 KB) [[attachment:lecture8_ifexample.py]]
  • [get | view] (2005-04-29 14:34:05, 0.5 KB) [[attachment:lecture9_password.py]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.

Unable to edit the page? See the FrontPage for instructions.