我如何在一个子过程中运行多个命令

时间:2019-12-16 15:54:19

标签: python

import subprocess
subprocess.Popen(['cd/users/Charis Charilaou/desktop/Umbra/Gaming/Minecraft/Minecraft Server/UmbraCraft Test-Server', 'run.bat'] ,shell=True)

1 个答案:

答案 0 :(得分:0)

您可以为此使用链接符号&&,例如:

subprocess.Popen(['cd /users/Charis Charilaou/desktop/Umbra/Gaming/Minecraft/Minecraft Server/UmbraCraft Test-Server && bash run.bat'], shell=True)