All my current coding has been in python 3, which I\'ve installed via the Anaconda package. However I need to work on some code simultaneously in python 2. Is there a way I
Specify the absolute path to the version of Python. For example, if Python version 3 is located at /usr/bin/python3 and Python version 2 is located at /usr/bin/python2:
Python 3 Build Configuration:
{
"cmd": ["/usr/bin/python3", "-u", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python",
"shell": true
}
Python 2 Build Configuration:
{
"cmd": ["/usr/bin/python2", "-u", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python",
"shell": true
}
Find the location of Python via which:
$ which python
/usr/bin/python
$ which python3
/usr/bin/python3
$ which python2
/usr/bin/python2
See Build system of Sublime Text 3 executes a different version of PHP, it is the same principal.