2024-04-26 23:06:57 发布
网友
有数百个问题涉及到Tkinter中的while True:循环(这当然会使它崩溃,因为它从不执行mainloop()(参见here和{a2}数百个示例中的两个))。显而易见的(目前为止)答案需要某种函数。在
while True:
mainloop()
我的问题是:有没有什么方法可以让Tkinter中的while True:循环类似,在不使用函数的情况下,不会崩溃?我没发现有这样的问题。在
我对python和tkinter不是很熟悉,但这应该可以:
import tkinter as tk import threading root = tk.Tk() thread = threading.Thread(target=root.mainloop) thread.start() while True: print("Hello, World!"); # TODO - add more stuff to this while loop
我对python和tkinter不是很熟悉,但这应该可以:
相关问题 更多 >
编程相关推荐