我一直在尝试制作一个tkinter游戏,一旦完成,它就会重新执行其自我。这是我尝试的代码:
from subprocess import run
.....
.....
.....
.....
run('python3 ' + __file__)
和
from subprocess import run
from os.path import dirname
.....
.....
.....
.....
run('python3 ' + dirname(__file__) + filename)
但是所有解决方案均无效。有没有一种方法可以让我的程序最后重新启动?谢谢!
def start():
.....
.....
.....
.....
while True:
start()