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

Attachment 'lecture7_text.py'

Download

   1 #!/usr/bin/python
   2 
   3 from Tkinter import *
   4 
   5 def Insert():
   6 	name = text.get()
   7 	list.insert(2, name)
   8 	text.delete(0,END)	
   9 
  10 root = Tk()
  11 root.geometry('200x210+350+70')
  12 
  13 text = Entry(root, bg = 'white')
  14 button = Button(root, text = "press me", command = Insert)
  15 
  16 list = Listbox(root, bg = 'blue', fg = 'yellow')
  17 
  18 
  19 text.pack(anchor = W)
  20 button.pack(padx = 4, pady = 4, anchor= E)
  21 
  22 list.pack()
  23 
  24 
  25 root.mainloop()
  26 	

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.