0

I know that there are lots of questions about running Python in Sublime Text 2, but i have a problem.

I've changed "Python.sublime-build" file in AppData package on this one

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

Where "C:\Program Files\Python32\python.exe" is my own path. When I press Ctrl + B. I see "building..." and than the inscription disapeers and nothing happens.

What to do. help me please!

1 Answer 1

1

You shouldn't be modifying any files in AppData/Roaming/Sublime Text 2/Packages/ unless they're in the User/ directory. Any changes will be overwritten upon upgrade, and if you break something (unless you've made backups) you might not be able to fix it without reinstalling.

So, change Packages/Python/Python.sublime-build back to the following:

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

Next, create a new file Packages/User/Python3.sublime-build with the following contents:

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

Save the file, then go to the Tools -> Build System menu and select Python3. You should now be able to run a Python 3 file by hitting CtrlB. I'd suggest running the one below, as it will show if your Python installation is working properly:

import sys print(sys.version) 
Sign up to request clarification or add additional context in comments.

2 Comments

The same result, nothing happens.
@Luchnik - are you sure that c:\Program Files\Python32 is the location of python.exe, and it has been installed properly? Also, what is the program you're trying to run? Try running the one at the bottom of my answer (make sure you save the file first). Also, try running it from the command line to ensure Python is working correctly.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.