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

前端 未结 4 1839
陌清茗
陌清茗 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 01:06

    Ok here is how I got it to work.

    env = os.environ
    proc = subprocess.Popen(args, env=env)
    

提交回复
热议问题