我知道相关的问题已经贴在哪里了,但我不知道它们的窍门。在
我有一个Powershell命令,把它放在Python中的一个字符串中,比如stringaa
。在
如何从Python运行命令aa
。我知道我应该使用subprocess
,但我不确定用什么方式。在
将aa
想象为cd ../data
,可以从当前文件夹到另一个文件夹,但也可以使用更复杂的命令,例如:
docker run --rm -v $pwd\xml\:C:\xml -i LocationOfRegistry powershell /C 'cat C:\xml\*.xml | python .\core-wrap\run.py' > output.csv
提前谢谢
您正在寻找popen。在
相关问题 更多 >
编程相关推荐