今日の話題は「Linuxでインストール済みのPythonを簡単に調べる」です。
PythonはデフォルトでLinuxにインストールされますがそのバージョンを簡単に知る方法が" which python{,2,3}"です。
■Python3がインストールされている
$ which python{,2,3}
/usr/bin/python3
/usr/bin/python3
■Python2をインストールする
$ sudo apt install -y python2
$ sudo apt install -y python2
■インストール済みのPythonのバージョンを確認する
$ which python{,2,3}
/usr/bin/python2
/usr/bin/python3
$ which python{,2,3}
/usr/bin/python2
/usr/bin/python3
■それぞれの詳細なバージョンを知る
$ python2 -V
Python 2.7.18rc1
$ python3 -V
Python 3.8.2
Python 2.7.18rc1
$ python3 -V
Python 3.8.2
■Windows上のUbuntu 20.04 LTSで実行しました
