Forked from zaemiel/How to link Sublime Text Build system to Python 3
Last active
August 7, 2019 23:49
-
-
Save wafiqsyed/1a12b4ea4e730a56c89d251c4b29aa50 to your computer and use it in GitHub Desktop.
Really quick way to make sure your Sublime Text is using Python 3 to run your code. I've edited this a bit. If you still have problems, visit the original repo and check the comments.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Check out my video tutorial here: | |
https://www.youtube.com/watch?v=IprbE2C_rsE | |
1. Make sure you save your file with a .py extension before trying to build/run it. | |
If you try to build before saving, it won't work. | |
2. Go to Sublime Text to: Tools -> Build System -> New Build System | |
and delete whatever is there. Copy and paste the following onto the empty file: | |
{ | |
"cmd": ["python3", "-i", "-u", "$file"], | |
"file_regex": "^[ ]File \"(...?)\", line ([0-9]*)", | |
"selector": "source.python" | |
} | |
Then save it (save it in the default directory that shows up when you press Save As) | |
with a meaningful name like: python3.sublime-build | |
3. Go to Tools -> Build system -> and check python3 | |
test it with: | |
import sys | |
print(sys.version) | |
Press: | |
Ctrl b (Windows) | |
Cmd b (Mac) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment