Home >Backend Development >Python Tutorial >How to check the current version number in Python_How to check the current version number in Python

How to check the current version number in Python_How to check the current version number in Python

王林
王林forward
2024-04-02 18:50:061131browse

1. First enter the Ubuntu system, and then use ‘Ctrl Alt T’ to open the Ubuntu command line terminal.

How to check the current version number in Python_How to check the current version number in Python

2. Then the Ubuntu system generally contains two versions of Python, python2 and python3. When we query the python version specified by the system by default, we use the command [python --version] to query.

How to check the current version number in Python_How to check the current version number in Python

3. Then the Ubuntu system generally contains two versions of Python, python2 and python3. When we query the corresponding python version, we use the command [python2 --version]/[python3 --version] to query.

How to check the current version number in Python_How to check the current version number in Python

4. In addition to the above methods, we can also enter Python to view. After entering Python, the current version number will pop up by default, command [python].

How to check the current version number in Python_How to check the current version number in Python

5. After finally entering python, you can use sys to query the system installation path and resource path corresponding to python, command [import sysprint(sys.path)].

How to check the current version number in Python_How to check the current version number in Python

The above is the detailed content of How to check the current version number in Python_How to check the current version number in Python. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:zol.com.cn. If there is any infringement, please contact admin@php.cn delete