http://tieba.baidu.com/p/2817124558
-
自信1995:
from Tkinter import * def a(): print Entry.get() root = Tk() Label(root,text = "Please input a number:").pack(side = LEFT) Entry(root).pack(side = RIGHT) Button(root,text = 'print_entry',command = a).pack(side = BOTTOM) root.mainloop()
-
仒緑嗏嗏:
回复 自信1995 :把控件布局分开写,举例:my_entry = Entry(root) 换行 my_entry.pack(side = RIGHT) 然后获取的话就my_entry.get()