Print("Current version of Python is ", platform. Check the Python Version on Windows On your Windows PC where you’ve installed Python, use the PC’s built-in PowerShell utility to check the version number. The other alternative way is to use a platform module in Python where you can leverage the built-in function platform.python_version() to print the current installed Python version in your machine. On Windows 7 and earlier, you can use the command prompt to check your Python version. Output Current version of Python is sys.version_info(major=3, minor=9, micro=7, releaselevel='final', serial=0) Print Python Version using platform Module Print("Current version of Python is ", sys.version_info) The version_infoproperty prints the Python version in tuple format, which gives detailed information as shown below. ![]() If you are looking for details on the version, such as major, minor, type of release, etc., you can use sys.version_infoproperty. ![]() Print("Current version of Python is ", sys.version) The sys module comes as a built-in utility with Python installation, and to check the Python version, use sys.version property. In this tutorial, you will learn how to print the version of the current Python installation from the script.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |