【发布时间】:2016-02-24 23:11:17
【问题描述】:
我正在运行以下代码:
p = subprocess.getoutput("python ./file.py")
如何确保使用的python版本是python3?
谢谢!
【问题讨论】:
-
您可能想要更改代码以便它在两者上运行:
p=subprocess.check_output('python ./file.py < input.txt', shell=True)
标签: python-2.7 python-3.x subprocess