subprocess.Popen(执行命令)

subprocess.Popen(arg, shell=True,cwd='path')

arg是你执行的命令,可以是字符串,也可以是列表/元组,如果 args 是字符串,它将作为命令行字符串通过shell 执行,(前提:sell=True)

cwd 不是None ,在子程序执行前,当前的工作目录将变为cwd(运行命令的路径)



未完,

猜你喜欢

转载自blog.csdn.net/qq_41993287/article/details/79939150