Subprocess.call or Subprocess.Popen cannot use executables that are in PATH (Linux/Windows)

前端 未结 4 1846
陌清茗
陌清茗 2021-01-02 00:14

I\'m writing a programme that needs to run on both Linux and Windows and use executables (with parameters) that exist in the path. (Assumed)

Currently I\'m having tr

4条回答
  •  长情又很酷
    2021-01-02 00:41

    I struggled with this myself until I found this python bug report.

    "If you add a directory into PATH on Windows so that the directory is in quotes, subprocess does not find executables in it." Since the quotes aren't required by windows removing them fixes my problem (in 2.7).

提交回复
热议问题