Last active
May 6, 2022 03:59
-
-
Save AJ-Acevedo/4f2c98c62aaa2b7b4c0582c9a4e8ba7b to your computer and use it in GitHub Desktop.
PyVer - A simple python script to show what version of python is being run by when executed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# PyVer | |
# Version 0.4 | |
# A simple python script to show what version of python is being run when executed. | |
# Author: AJ Acevedo - GitHub @AJ-Acevedo | |
import sys | |
major_ver = sys.version_info[0] | |
minor_ver = sys.version_info[1] | |
micro_ver = sys.version_info[2] | |
# Three alternate methods | |
# print(sys.version_info) | |
# print('Python Version ', sys.version_info[0], '.', sys.version_info[1], '.', sys.version_info[2]) | |
# print("Python Version {0}.{1}.{2}".format(*sys.version_info)) | |
print('Python {0}.{1}.{2}'.format(major_ver, minor_ver, micro_ver)) |
obeleh
commented
Apr 16, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment