Execute Python in Sublime Text 2, Windows 8

Mike Thomas · 146K views · 2014 · 3:05

Open on YouTube

Testing, debugging & developer toolsPython, Ruby & scripting languagestutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it when someone cannot get Sublime Text to build and run Python, especially on Windows where the Python path or build config is the usual culprit.

Recommended by 2 people across 2 different months, 2014 to 2017.

What it is

A short screencast showing how to run Python scripts from inside Sublime Text 2 on Windows 8. It covers telling Sublime where Python is installed by editing the build configuration. It is presented by Mike Thomas and tied to a Stack Overflow question about SublimeREPL.

What people said

Recommends jkarimi · 2014-11 · Stack Overflow · on “'\r' added to end of everything input in python”

Sublime text allows you to build and execute python script as well [this video] . You can also find very many useful plugins and install them using Package Control [LINK] .

Recommends Malik Brahimi · 2015-03 · Stack Overflow · on “execute python in sublime text”

Sublime, if you haven't noticed already, is created with Python so you can expect it to have full support for the language. Based on your error, I'd venture to guess that you haven't added Python to your path. Watch the video here [LINK] for instructions. Otherwise, you can watch this [this video] video for how to change build configurations.

Cites Anthony Aquino-Lopez · 2015-11 · Stack Overflow · on “How do I run python 3.4 on sublime text 2?”

This is what my python build looks like: { "cmd": ["python", "-u", "$file"], "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)", "selector": "source.python" } I've read that I need to change what's in the "python" part of "cmd":, but I can't find what to change it to. I've seen one video [this video] where a guy made it look really easy by taking the path from the terminal. Others say to add a "path": blah blah blah. It always seems to be for Windows computers. I've tried so many things and I really don't know what to change to make sublime text 2 to run python. Also does it make a difference if I'm using a mac vs windows?

Cites joydeep bhattacharjee · 2017-02 · Stack Overflow · on “sublime text + python's anaconda”

Sublime console is not made an interactive console. When you run the python code it actually runs the file. You can check this by typing 1+1 in a file, saving it in a .py format and then running the file as python -u filename.py which is how sublime executes the code as seen in [this video] at 2:36. You can check the same response to a similar question in this discussion forum as well. [LINK]