我正在尝试.bat在新窗口中运行文件(充当模拟器),因此该文件必须始终在后台运行。我认为创建新流程是我唯一的选择。基本上,我希望我的代码执行以下操作:
def startSim:
# open .bat file in a new window
os.system("startsim.bat")
# continue doing other stuff here
print("Simulator started")
Run Code Online (Sandbox Code Playgroud)
我在Windows上无法使用os.fork。