Run Python code in Sublime Text 3

To Run Python script inside Sublime Text 3, first, you need to install a version of Python.

After you do it, open Command Line and type:

I run Python 3.7.2 on my computer. Now, that we are sure that the Python is correctly installed and paths are added to Environment Variables, you can install and open Sublime Text 3 editor.

Click the Windows search icon, and enter “sublime”. A new icon will appear.

Click it to open the editor.

After you open Sublime Text, you have an empty file. You can write code, but before you do that, go to Tools >> Build System >> Python.

Now, after the build system is set, you can save your file (Ctrl + S), and don’t forget about the file extension. I named my file “hello.py”.

Running the code

Enter code and navigate to Tools >> Build or Ctrl + B.

If you want to break the code, before it finishes, go to Tools >> Cancel Build.