小编use*_*701的帖子

Python调用多个命令

我想从我的python脚本调用多个命令。我尝试使用os.system(),但是在更改当前目录时遇到问题。

例:

os.system("ls -l")
os.system("<some command>") # This will change the present working directory 
os.system("launchMyApp") # Some application invocation I need to do.
Run Code Online (Sandbox Code Playgroud)

现在,第三个调用启动无效。

python command subprocess

5
推荐指数
3
解决办法
3万
查看次数

标签 统计

command ×1

python ×1

subprocess ×1