子进程无法调用函数

时间:2018-02-04 08:32:57

标签: python-3.x subprocess

我正在尝试使用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

我在这里做错了什么?

0 个答案:

没有答案