我正在编写一个脚本,该脚本要求程序在屏幕上显示消息框时继续运行。我希望它仍然执行我的程序,但在脚本运行时会出现一个消息框
我一直在使用Tkinter制作消息框,我可以在屏幕上显示多个。然而,如果我试图在消息框显示在屏幕上时运行代码,它就不起作用了。
这是我的代码:
import tkinter as tk
from tkinter import ttk
root = tk.Tk()
root.withdraw()
for i in range(0,5):
f = tk.Toplevel(root)
f.resizable(False, False)
f.geometry("150x75+100+100")
f.title("MessageBox")
ttk.Label(f, text="This is a Test").pack()
print("test")
root.mainloop()
while True:
print("doing code while there are msgboxes on screen")
我希望它做的是在我的屏幕上画出消息框,然后继续代码,就像我没有那样。
任何帮助都将不胜感激,谢谢!