This article will share with you the author the different solutions for running python command lines in Windows and Linux systems. if you have the same requirements, refer to the following, after completing a small python exercise, the main content of the exercise is to read a help module and save it to a local file.
It is known that pydoc is used to read the module, but in windows, the result is always blank after the OS module is called.
Core statement:
Helpfile = OS. popen ('pydoc % s' % module). read ()
This statement runs normally in Linux and the result is normal.
Later it was found that in Windows, the modification was as follows:
Helpfile = OS. popen ('Python-m pydoc % s' % module). read ()
To run the command line, use the command line statement of Windows.
The above is all the content of this article, hoping to help you learn Python