tkinter中的messagebox
程序员文章站
2022-12-21 14:07:46
from tkinter import * from tkinter import messagebox def myMsg(): messagebox.showinfo("My Message Box","小伙子,下午好!") root =Tk() root.title("messagebox练习 ......
from tkinter import * from tkinter import messagebox def mymsg(): messagebox.showinfo("my message box","小伙子,下午好!") root =tk() root.title("messagebox练习") # root.geometry("300*160") button(root,text="按钮",command=mymsg).pack() root.mainloop()
from tkinter import * from tkinter import messagebox def mymsg1(): ret=messagebox.askretrycancel("text1","安装失败,再试一次?") print("安装失败",ret) def mymsg2(): ret=messagebox.askyesnocancel("text2","编辑成功,是或否或取消") print("编辑完成",ret) root =tk() root.title("messagebox练习") button(root,text="安装失败",command=mymsg1).pack() button(root,text="编辑完成",command=mymsg2).pack() root.mainloop()
上一篇:
标签 让一段计算机代码显示在网页中
下一篇: Go gRPC 调试工具