Sys.version - System-specific parameters and functions - Python 3.7. Sys.version is a string indicating various information, including the version number.Ī string containing the version number of the Python interpreter plus additional information on the build number and compiler used. ![]() Various information strings including version number: sys.version It is also be used when you want to switch operations depending on whether it is Python2 or Python3. Even though you thought Python3 was running, there was a case where Python2 was running, so if something goes wrong, check it once. Summary It’s easy to install multiple versions of python on a Mac computer using installers from, Homebrew, Conda, or other sources. Now, this is going to give you the version number of python installed on your computer. It is useful for checking which version of Python is running in an environment where multiple versions of Python are installed. To see the Python version on a Windows computer, open Powershell and type: python -version. The same script can be used on Windows, Mac, and Linux, such as Ubuntu. You can use the standard library sys module or platform module to get the version of Python that is actually running. ![]() Python 3.7.0 (default, Jun 29 2018, 20:13:13 ) Check the Python version in the script: sys, platform
0 Comments
Leave a Reply. |