OSError: [Errno 2] No such file or directory while using python subprocess in Django

前端 未结 3 1439
不知归路
不知归路 2020-11-28 20:12

I am trying to run a program to make some system calls inside Python code using subprocess.call() which throws the following error:

Traceback (m         


        
3条回答
  •  遥遥无期
    2020-11-28 20:40

    Can't upvote so I'll repost @jfs comment cause I think it should be more visible.

    @AnneTheAgile: shell=True is not required. Moreover you should not use it unless it is necessary (see @ valid's comment). You should pass each command-line argument as a separate list item instead e.g., use ['command', 'arg 1', 'arg 2'] instead of "command 'arg 1' 'arg 2'". – jfs Mar 3 '15 at 10:02

提交回复
热议问题