I'm wondering what should someone generally know about Python(the interpreter) when using it in the shell in Linux? This is what I have on Gentoo:
# ls -al /usr/bin/python*; file /usr/bin/python; /usr/bin/python-wrapper --version
lrwxrwxrwx 1 root root 14 Dec 26 04:49 /usr/bin/python -> python-wrapper
lrwxrwxrwx 1 root root 9 Dec 26 04:51 /usr/bin/python2 -> python2.7
-rwxr-xr-x 1 root root 6144 Jan 8 21:22 /usr/bin/python2.7
-rwxr-xr-x 1 root root 1450 Jan 8 21:22 /usr/bin/python2.7-config
lrwxrwxrwx 1 root root 9 Dec 26 04:49 /usr/bin/python3 -> python3.3
-rwxr-xr-x 1 root root 10304 Jan 19 20:37 /usr/bin/python3.3
-rwxr-xr-x 1 root root 1753 Jan 19 20:37 /usr/bin/python3.3-config
-rwxr-xr-x 1 root root 217 Dec 26 04:49 /usr/bin/python-config
lrwxrwxrwx 1 root root 16 Jan 8 21:22 /usr/bin/python-config-2.7 -> python2.7-config
lrwxrwxrwx 1 root root 16 Jan 19 20:37 /usr/bin/python-config-3.3 -> python3.3-config
-rwxr-xr-x 1 root root 10384 Dec 26 05:24 /usr/bin/python-wrapper
/usr/bin/python: symbolic link to `python-wrapper'
Python 3.3.3
So in my case calling python
launches version 3.3. On most of the distributions I used, there was more than one version installed. And the latest version isn't backward compatible, and some of its features were backported to the "old" one. I thought the two versions situation was something temporary? Now each time I need to run a Python script I try it with both Python versions just to make sure.
Should I know anything else about using Python in the shell i.e. to run scripts; if so, what? Someone who makes a python script and uses env python
in the first line, does he/she mean it should be compatible with both versions? What is the use for the python-wrapper in all that?