如何使用subprocess.Popen打开/运行.py文件?

时间:2014-09-12 16:41:12

标签: python subprocess

我阅读了subprocess.Popen的文档,但我仍然有点困惑。我想这可能是由于我对命令行输入缺乏了解。

出于我的目的,我希望运行一个名为hithere.py的python程序,并在其后输入其他命令行。

例如:

/path/to/file/hithere.py command1 command2 command3

我也试图理解文档中的示例参数

https://docs.python.org/2/library/subprocess.html#popen-constructor

['/bin/vikings', '-input', 'eggs.txt', '-output', 'spam spam.txt', '-cmd', "echo '$MONEY'"]
>>> p = subprocess.Popen(args) 

有人可以在论证背后解释这个逻辑吗?

0 个答案:

没有答案
相关问题