Sublime Text shows nothing on Python build

775 views Asked by At

I'm learning Python in recent days and discovered I can use Sublime Text as Python text editor. However I always runned my programs at the "C:\Python34" folder. Now I tried to put my codes in another folder, out of this one, but I don't know why it's not working. Work just at the "Python34" folder...

The console status only shows "Building" and nothing...

My "Python.sublime-build" file:

{
    "cmd": ["python", "-u", "$file"],
    "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
    "selector": "source.python",
    "encoding": "utf8"
}

Sublime Text 2; Python 3.4; Windows 8.1

Any idea?

1

There are 1 answers

3
maccartm On

Try make sure you have Python in your system path:

  1. Windows key + Pause/Break key to shortcut to System.

  2. Click on Advanced System Settings.

  3. Scroll down in System Variables until you find "Path", click "edit"

  4. Look for C:\Python34 in the string; if it's there don't worry, if not, add it in as follows: someDirectory\lastItem;C:\Python34. Seperate with semi-colon. (for windows).

Now, you can change your Python.sublime-build file as follows:

{
    "cmd": ["C://Python34/python.exe", "-u", "$file"],
    "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
    "selector": "source.python"
}

If needed, change the directory for Python, or change "34" to whichever version you use. Should do the trick.

EDIT: Feel free to leave in your encoding, I just copy/pasted my sublime-build.