- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How do I check what version of Python is running my script?
Python version is displayed on console immediately as you start interpreter from command line
C:\Users\acer>python Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 18:41:36) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.
Version information is present in version attribute defined in sys module
>>> import sys >>> sys.version '3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 18:41:36) [MSC v.1900 64 bit (AMD64)]'
Another attribute version_info is more elaborate. It provides major, minor and micro version levels.
>>> import sys >>> sys.version_info sys.version_info(major=3, minor=6, micro=1, releaselevel='final', serial=0)
There is also hexversion attribute which provides a unique number associated with the version. If converted using hex() function, it indicates the version.
>>> sys.hexversion 50725360 >>> hex(50725360) '0x30601f0'
- How I can show progress of long running PYTHON CGI script?
- Why do I get Internal Server Error 500 in my Python CGI script?
- Which version is my MySQL?
- What is a Test Script and how do I write one?
- What environment variables do I need to set up before I start running Java programs on my machine?
- What Should I Do If My IP Address Is Exposed?
- How do I install selenium latest version?
- How can I check the version of MySQL Server?
- How I can check a Python module version at runtime?
- How to secure my Python CGI script?
- How to check version of python modules?
- How do I find the location of my Python site-packages directory?
- Why do I get premature end of script headers Error in Python CGI script?
- How to improve the performance of my Python CGI script?
- How to manipulate figures while a script is running in Python Matplotlib?