OSError: [Errno 8] Exec format error

后端 未结 5 1096
孤街浪徒
孤街浪徒 2020-12-05 13:09

I am having hard time parsing the arguments to subprocess.Popen. I am trying to execute a script on my Unix server. The script syntax when running on shell prompt is as fol

5条回答
  •  清歌不尽
    2020-12-05 13:43

    If you think the space before and after "=" is mandatory, try it as separate item in the list.

    Out = subprocess.Popen(['/usr/local/bin/script', 'hostname', '=', 'actual server name', '-p', 'LONGLIST'],shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
    

提交回复
热议问题