1# To check your Python version in the command line use:
2python --version
3
4# To check your Python verson inside a script use:
5import sys
6print(sys.version)
1# View as version vise:
2for p in $(compgen -c python); do printf "%-16s" $p; $p --version; done
3python2.7 Python 2.7.6
4python3.4m Python 3.4.3
5
6# view as:
7$ compgen -c python
8python2.7
9python3.4m
1# check all python version install in ubuntu
2$ ls /usr/bin/python* # for path and version
3$ whereis python # for path and version
4$ which python # for path
5$ ls -lach /usr/bin/python
6$ for p in $(compgen -c python); do printf "%-16s" $p; $p --version; done