Home Download Buy Blog Forum Support

Python Build System on Windows

Python Build System on Windows

Postby natemartinsf on Wed Nov 16, 2011 5:12 pm

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 <then the file path>

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?
natemartinsf
 
Posts: 2
Joined: Wed Nov 16, 2011 5:09 pm

Re: Python Build System on Windows

Postby johtso on Fri Nov 18, 2011 12:29 pm

Does your build system look like this?

Code: Select all
{
    "cmd": ["python", "C:\\my\\script\\script.py"]
}


Note the escaped slashes, and the different sections of the command as separate string in a list.
johtso
 
Posts: 8
Joined: Thu Sep 22, 2011 11:06 pm

Re: Python Build System on Windows

Postby natemartinsf on Fri Nov 18, 2011 10:11 pm

RIght now it's the default:

Code: Select all
"cmd": ["python", "-u", "$file"],


How can I make $file spit out the path with the correct escaped slashes?
natemartinsf
 
Posts: 2
Joined: Wed Nov 16, 2011 5:09 pm


Return to Technical Support

Who is online

Users browsing this forum: Yahoo [Bot] and 18 guests