我正在尝试使用subprocess.Popen
调用函数:
proc = subprocess.Popen(["/usr/local/bin/qstat", "-u", "rudrab"],stdout=subprocess.PIPE)
numjobs = proc.stdout.read()
给出错误:
Traceback (most recent call last):
File "genpos.py", line 159, in <module>
proc = subprocess.Popen(["/usr/local/bin/qstat", "-u", "rudrab"],stdout=subprocess.PIPE)
File "/opt/python-3.5/lib/python3.5/subprocess.py", line 950, in __init__
restore_signals, start_new_session)
File "/opt/python-3.5/lib/python3.5/subprocess.py", line 1544, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/bin/qstat'
但qstat
在我的路上:
which qstat
/usr/local/bin/qstat
我在这里做错了什么?