from
Tkinter
import
*
from tkMessageBox import *
root = Tk()
root.mainloop()
from tkMessageBox import *
root = Tk()
root.mainloop()
如图:
放个按钮,注册个事件BtnClick.py
![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![ExpandedBlockStart.gif](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
from
Tkinter
import
*
from tkMessageBox import *
def button_click():
showinfo( ' first application ' , ' Hello world! ' )
root = Tk()
b = Button(root,text = ' OK ' ,command = button_click)
b.pack(side = TOP)
root.mainloop()
from tkMessageBox import *
def button_click():
showinfo( ' first application ' , ' Hello world! ' )
root = Tk()
b = Button(root,text = ' OK ' ,command = button_click)
b.pack(side = TOP)
root.mainloop()
如图