最佳答案
当执行 巨蟒文件中给出的 subprocess.run()
时,我得到一个 TypeError:
>>> import subprocess
>>> subprocess.run(["ls", "-l", "/dev/null"], capture_output=True)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.6/subprocess.py", line 403, in run
with Popen(*popenargs, **kwargs) as process:
TypeError: __init__() got an unexpected keyword argument 'capture_output'
我正在运行 Python 3.6。6:
$ python3 --version
Python 3.6.6