subprocess.Popen(): OSError: [Errno 8] Exec format error in python?

前端 未结 7 2083
余生分开走
余生分开走 2020-12-06 09:07

Yesterday, I wrote and ran a python script which executes a shell using subprocess.Popen(command.split()) where command is string whic

7条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-06 09:38

    I solved this by putting this line at the top of the called shell script:

    #!/bin/sh

    That will guarantee that the system always uses the correct interpreter when running your script.

提交回复
热议问题