将多个python脚本运行到特定路径

2024-06-30 07:45:17 发布

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

我正在尝试从不同的路径运行多个文件。我想知道,如果我可以有相同的文件夹中的脚本定位的结果

import os
print ("Starting tablete_tot")
os.system(r"python D:\python\test\tableta_wi_fi_tot.py")
print ("tablete_tot ended")
print ("Starting tasatura_fara_fir_noutati")
os.system(r"python D:\python\test\tasatura_fara_fir_noutati.py")
print ("tasatura_fara_fir_noutati ended")
print ("Starting mouse_pad_tot")
os.system(r"python D:\python\test\x\mouse_pad_tot.py")
print ("mouse_pad_tot ended")

我需要结果与脚本在同一个文件中


Tags: 文件pytestossystemprintstartingpad