当有多个python文件需要依次运行时
1 依次运行多个python文件
import os
cmd = 'python preprocess.py'
os.system(cmd)
cmd = 'python train.py'
os.system(cmd)
cmd = 'python test.py'
os.system(cmd)
cmd = 'python postprocess.py'
os.system(cmd)
参考文献
(4条消息) 如何按顺序先后执行多个python文件(多个程序)_LJC的博客-CSDN博客_python顺序执行多个py文件的方法
https://blog.csdn.net/weixin_43818631/article/details/119705947