建议使用subprocess模块。
使用方法如下:
>>> subprocess.call([
"ls",
"-l"])
0
>>> subprocess.call(
"exit 1", shell=
True)
1
第一种,默认shell=False。注意,shell=False推荐使用列表的方式,而不是像第二种的字符串形式。
第二种,使用shell=True。注意,shell=True推荐使用字符串形式,而不是列表形式。
在python中,推荐使用第一种shell=False的形式。shell=True,不能保证各个平台的兼容性。
转载于:https://www.cnblogs.com/simpleminds/p/7575031.html
相关资源:DirectX修复工具V4.0增强版