How to run two commands in one subprocess call? [closed]

落花浮王杯 提交于 2020-12-27 07:30:22

问题


I would like to run the following commands in Python, using the package subprocess.

cd C:\Users\...\csv
attrib +U -P /s

In my mind, I would like to do something like

cmd = [r'C:\Users\...\csv','attrib +U -P /s']
pro = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True)

but this command clearly doesn't work.

来源:https://stackoverflow.com/questions/65449000/how-to-run-two-commands-in-one-subprocess-call

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!