4 - Writing Our First Python Code
4 - Writing Our First Python Code
You can see the version of Python that's being used for the REPL (command line) or to
execute your files when running python --version .
If this says Python 2.7 (or anything else but some version starting with 3 - e.g. 3.5), you
can run Python 3.x by executing python3 instead of just python .
This is especially important on macOS, where you already got Python 2.7 pre-
installed. To NOT use that, run python3 instead of python .
Alternatively, you change the Python version used by default as discussed and described
in this thread: https://stackoverflow.com/questions/18425379/how-to-set-pythons-default-
version-to-3-3-on-os-x
You essentially can run these two commands to change the default version being used:
unlink /usr/local/bin/python
ln -s /usr/local/bin/python3.6 /usr/local/bin/python