How to verify successful installation of python

For windows system, run -cmd, enter the dos window, enter python, if the installation is successful, you can see the version information and enter the programming mode, as shown in the figure below (the version I installed is python 2.7.13)

Type: print'hello world' and press Enter. Printed successfully.

No error is reported, indicating that Python has been successfully installed.

Content expansion:

What is a good way to check whether a package is installed inside a Python script? I know this is easy from the interpreter, but I need to do this in a script.
I think I can check if there is a directory on the system created during the installation, but I think there is a better way. I am trying to make sure that the Skype4Py package is installed, if not I will install it.

My thoughts, complete inspection

Check the directories in the typical installation path

Try to import the package, if an exception is thrown, install the package

If you mean a python script, just do this:

try:import mymodule
except ImportError, e:
 pass # module doesn't exist, deal with it.

So far, this article on how to verify the successful installation of python is introduced. For more related python installation verification methods, please search for previous articles on ZaLou.Cn or continue to browse related articles below. Hope you will support ZaLou.Cn more in the future. !

Recommended Posts

How to verify successful installation of python
How to comment python code
How to learn python quickly
How to uninstall python plugin
How to understand the introduction of packages in Python
How to understand a list of numbers in python
Example of how to automatically download pictures in python
How to understand python objects
Python version of OpenCV installation
How to use python tuples
How to find the area of a circle in python
python how to view webpage code
How to use python thread pool
How to write python configuration file
How to wrap in python code
How to save the python program
How to omit parentheses in Python
How to install Python 3.8 on CentOS 8
How to install Python 3.8 on Ubuntu 18.04
How to write classes in python
How to filter numbers in python
How to read Excel in Python
How to install Python on CentOS 8
How to solve python dict garbled
How to view errors in python
How to write return in python
How to view the python module
How to understand variables in Python
How to clear variables in python
How to understand python object-oriented programming
How to use SQLite in Python
Installation of python common libraries under windows
How to make a globe with Python
How to use and and or in Python
How to delete cache files in python
How to introduce third-party modules in Python
How to represent null values in python
How to secure Redis installation on Ubuntu 14.04
How to save text files in python
How to optimize Tomcat installation on Ubuntu 14.04
How to use PYTHON to crawl news articles
How to write win programs in python
How to run id function in python
How to install third-party modules in Python
How to custom catch errors in python
200 lines of Python code to achieve snake
How to write try statement in python
How to define private attributes in Python
R&D: How To Install Python 3 on CentOS 7
How to add custom modules in Python
How to process excel table with python
How to understand global variables in Python
How to view installed modules in python
How to install Python2 on Ubuntu20.04 ubuntu/focal64
How to debug python program using repr
How to learn the Python time module
How to open python in different systems
How to sort a dictionary in python
How to get started quickly with Python
How to enter python triple quotation marks
How to add background music in python