python的第一个面向对象?emmm就是一个button
import tkinter import tkinter.messagebox win = tkinter.Tk() win.title('a little try') win.geometry('300x200+260+160') //其中300x200是长宽,260和160是左上角在屏幕的坐标轴 def click(): lb.config(text='happy u!') tkinter.messagebox.showinfo(title='信息',message='welcome!') //这个就是messagebox.show() bt = tkinter.Button(win,text='单机',width=20,command=click) bt.place(x=80,y=60) lb=tkinter.Label(win,text='单击按钮试试...') lb.place(x=110,y = 110) win.mainloop() //调用该函数启动