How to make Sublime-Text build with Python3 in Unix

1. "Preferences"-->"Settings" open a new window, then "Tools"-->"Build system"-->"New Build System"


2. Put this in:

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

3. Save as "Python3.sublime-build" in "Packages/User/" folder.


4. Go to "Build system", change it to "Python3".


5. OK, everything is alright, press "Ctrl + B" running codes, have fun!


PS:

If you don't know where Python3 is, just open Terminal, inputting "which python3" + Enter, then you'll get Python3 path if you already installed.

你可能感兴趣的:(How to make Sublime-Text build with Python3 in Unix)