Python 3 vs. Python 2


#1

I am in the process of learning Python, and considering upgrading from the Python 2.7.15+ currently installed in my Linux parrot 4.18.0-parrot8-amd64 to Python 3.7.xx

Are there any known problems or issues I should be aware of, or reason not to upgrade?
What would be the safest method of doing the upgrade so I don’t mess anything else already in the ParrotOS?


(Matt) #2

python 3.7 should already be installed. You can use both.

Lets say you have test.py
You could do:
python2.7 test.py
or
python3.7 test.py


There's any problem with updating Python
#3

Thanks, I found it…

  • actually the Python 3 version that is installed on Linux parrot 4.18.0-parrot8-amd64 is Python 3.6.6 (default, Jun 27 2018, 14:44:17)

(Lorenzo "Palinuro" Faletra) #4

Parrot (and Debian) provide both python3 and python2 support.

the python2 supported version Python 2.7.15+ and it is kept only for legacy reasons.

/usr/bin/python is a symlink to /usr/bin/python2 because very old python2 scripts are not aware of the existence of python3 and expect /usr/bin/python to be a python 2 interpreter.

Parrot (and Debian) also support python 2.6 and 2.7 which are both pre-installed.

python3 is a symlink to python3.6, but you can manually use the python3.6 and python3.7 commands to execute the python flavor you prefer.