Sublime Forum

Python Build System on Windows

#1

Hi-

Hope someone can help with this, I’ve tried searching, but was unable to find an answer.

I’m using Sublime Text 2 running on Windows XP. (Yeah yeah, I know. I’d change to 7, or use a mac, if I could.)

I’m writing a bunch of python, and I would like to make use of the build system in Sublime Text to run my script when I hit F7. Unfortunately, I just get an error message:

[Error 2] The system cannot find the file specified
[Finished]

If I look at the console, the command it is running is:

Running python -u

My python directory is in my PATH. If I copy the command written in the console into powershell, it runs fine. I’ve tried both python and python.exe. There are no spaces in the file path.

Any ideas?

0 Likes

#2

Does your build system look like this?

{ "cmd": "python", "C:\\my\\script\\script.py"] }

Note the escaped slashes, and the different sections of the command as separate string in a list.

0 Likes

#3

RIght now it’s the default:

"cmd": "python", "-u", "$file"],

How can I make $file spit out the path with the correct escaped slashes?

0 Likes