从单个文件运行三个Tkinter应用程序

2024-10-03 09:13:34 发布

您现在位置:Python中文网/ 问答频道 /正文

我想运行3个python文件,每个文件都包含Tkinter应用程序。 问题是3个文件位于电脑上的3个不同位置

我成功地将文件放入2个函数中,在调用时运行,但问题是,当我运行脚本时,它会等待第一个Tkinter窗口关闭,然后运行rest应用程序

守则:

def openRegisterApplication():
    os.chdir(dirsFolderToChdir['GUI'])
    os.system(f'python {expectedRegister_Application}')
def openBackEnd():
    os.chdir(dirsFolderToChdir['FaceR'])
    os.system(f'python {expectedFaceR_cam_1} & python {expectedGUI_Deshboard}')
Thread(target = openRegisterApplication()).start()
Thread(target = openBackEnd()).start()

Tags: 文件函数应用程序targetostkinterdefsystem