小编Vik*_*ram的帖子

在Windows上的后台运行.bat程序

我正在尝试.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

python subprocess background process batch-file

5
推荐指数
1
解决办法
5391
查看次数

标签 统计

background ×1

batch-file ×1

process ×1

python ×1

subprocess ×1