Run two python files at the same time

前端 未结 4 1798
遥遥无期
遥遥无期 2021-01-13 23:25

I have tried using

#!/bin/bash
python ScriptA.py &
python ScriptB.py &

to run both scripts at the same time but it always returns

4条回答
  •  庸人自扰
    2021-01-14 00:08

    You can try os.system :

    import os
    
    os.system("python ScriptA.py &")
    os.system("python ScriptB.py &")
    

提交回复
热议问题