Skip to main content

Run the following command to print the current environment installed Python version.

$ python -c "import sys;print('.'.join(map(lambda x: str(x), sys.version_info[:2])))"

# or using command substitution:
$ python_ver=$(python -c 'import sys; print(sys.version[0])')

# for dos batch examples see:
# https://github.com/timonwong/SublimeAStyleFormatter/blob/master/src/win_build_all.bat