我制作了一个python代码如下,多个exe程序同时运行。但是,如果我使用此代码,则不是在每个文件夹中创建输出文件,而是在 python 文件所在的文件夹 (Folder0) 中创建输出文件。然后将相同文件名的输出文件重叠在同一文件夹中,从而发生错误。如何在每个文件夹 Folder1 和 Folder2 中创建输出文件
python文件位于“c:/Folder0” exe程序1位于“c:/Folder0/Folder1” exe程序2位于“c:/Folder0/Folder2”
import threading
def exe1():
os.system( '"C:\\Users\\FOLDER0\\FOLDER1\\MLTPad1.exe"' )
def exe2():
os.system('"C:\\Users\\FOLDER0\\FOLDER2\\MLTPad2.exe"')
if __name__ == "__main__":
# creating thread
t1 = threading.Thread(target=exe1, args=())
t2 = threading.Thread(target=exe2, args=())
# starting thread 1
t1.start()
# starting thread 2
t2.start()
# wait until thread 1 is completely executed
t1.join()
# wait until thread 2 is completely executed
t2.join()
# both threads completely executed
print("Done!")