tkinter.py

from tkinter import *
def hello():print('hello world')
win=Tk()
win.title('hello tkinter')
win.geometry('200x100') #x不是*
btn=Button(win,text='hello',command=hello)
btn.pack(expand=YES,fill=BOTH)
mainloop()
原文地址:https://www.cnblogs.com/feifeidxl/p/5617903.html