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()
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()