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