banner



How To Check How Many Python Versions Are Installed

How to Check Your Python Version?

Y'all can use the standard library sys module or platform module to get the version of Python that is really running.


Check Python Version Windows 10

From control line

You can see which version of Python is installed on your OS using the control line .

  1. python -Five

(Note: capital 'V')

Check Python version from command line / in script

Which version of Python is running my script?

In Python ii.7 and later, the components of sys.version_info tin can besides be accessed by proper noun, so sys.version_info[0] is equivalent to sys.version_info.major and so on.

Here, sys.version_info[0] is the major version number. sys.version_info[1] would give you the small-scale version number.

Platform Module in Python

Python defines an in-congenital module platform that provides system information. You can use the platform module to get the version of Python that is really running.

Python is being updated regularly with new features and supports. There are lots of update in Python versions, started from 1994 to current release. Python Implementation started on December, 1989 and reached version ane.0 in January 1994. Like many other programming languages, there can be several different versions organized by release appointment.

Python Versions

The standard version scheme is designed to encompass a wide range of identification practices beyond public and private Python projects. A tuple containing the five components of the version number : major, minor, micro, releaselevel, and serial. All values except release level are integers; the release level is 'alpha', 'beta', 'candidate', or 'final'. The version_info value corresponding to the Python version 2.0 is (2, 0, 0, 'final', 0).

Run the Python command-line interpreter:

  1. Open up Command line: Start card -> Run and type cmd
  2. Type: C:\Python34\python.exe

How to Check Python Version in Various OS

Hither you can run across, Python version is displayed on console immediately as you lot start interpreter from command line. The details are a string containing the version number of the Python interpreter plus additional information on the build number and compiler used.

From control line

You can check which version of Python is installed on your operating system using the control line using the following command.

  1. C:\Python34> Python -c "print(__import__('sys').version)"

How to check Python version in Mac Linux Unix

Check Python Version from your program

You tin can programmatically determine which version of Python is installed on the arrangement where the Python script is running.

For example, to check that you are running Python three.x , utilize:




Source: http://net-informations.com/python/intro/version.htm

Posted by: mccleandonfe1985.blogspot.com

0 Response to "How To Check How Many Python Versions Are Installed"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel