先上例子:
from Tkinter import *
def on_click():
label['text'] = text.get()
root = Tk(className='bitunion')
label = Label(root)
label['text'] = 'be on your own'
label.pack()
text = StringVar()
text.set('change to what?')
entry = Entry(root)
entry['textvariable'] = text
entry.pack()
button = Button(root)
button['text'] = 'change it'
button['command'] = on_click
button.pack()
root.mainloop()
其他资料:
python GUI例子:http://www.cnblogs.com/monsteryang/p/6558904.html
python GUI编程:
https://zhuanlan.zhihu.com/p/22619896?refer=passer