Output (example): sys.version_info(major=3, minor=9, micro=0, releaselevel='final', serial=0) Use the Platform ModuleĪnother way to access the version information on a Python script is by using the platform module. Or if you want to get this info as a tuple, access the version_info property: import sys To get the basic version information directly from a Python script, use the built-in sys module: import sys But what if you want to check the version from a script directly? Now you know how to check your Python version on a command-line tool. Running -VV on < Python 3.6 does not show the additional info. Notice, however, that this option was added to Python 3.6+. This command gives you more detailed version information. To get more specific version information of Python3, run python3 -VV: $ python3 -VV This is just a shorthand for python -version. But there are other commands too.Īlternatively, you can use python -V too. The clearest way to figure out the Python version is running python -version on a command-line application. How to Check Your Python Version Overview
0 Comments
Leave a Reply. |