kettlepot
kettlepot

Reputation: 11011

Popen gives "File not found" Error (windows/python)

I'm trying to run console commands via subprocess.Popen, and whenever I run it I get the windows "File not found" error, even when running the echo command. I am also using Popen inside a thread made with the thread module. Is that the problem?

Upvotes: 2

Views: 5256

Answers (2)

wallyk
wallyk

Reputation: 57804

Instead of
D:\Program Files\Steam\steamapps\terabytest\sourcesdk\bin\orangebox\bin\vbsp.exe, use
D:/Program Files/Steam/steamapps/terabytest/sourcesdk/bin/orangebox/bin/vbsp.exe

This eliminates any complications with backslashes inside quotes.

Upvotes: 5

Maxim Razin
Maxim Razin

Reputation: 9466

echo is not an executable, it's an internal command inside cmd.exe. If you want to use Popen with internal commands, add a keyword parameter shell=True

Upvotes: 3

Related Questions