Dir function to view the properties of an object
The use of the method is simple, for example, the OS type, in the Python command Window input dir (' OS ') to view the properties of the OS module
Open cmd Command Window
Enter Python (note: The computer needs a Python environment and the Python environment variable is configured)
Enter the dir (' os ') command
How do I see the help document for a property of an object?
To view the ' OS ' Split property, you can use __doc__, using the method print (' OS '. split.__doc__)
Print (' OS '. split.__doc__)
You can also use the Help function to view a property of an object, using the.
Help (' OS '. Split)
Help (' OS '. Strip)
View detailed documentation for an object with help
You can use Help (' OS ') for detailed documentation of the STR type. If the document has a lot of content, help lists all parts of the document and prompts "-more--" in the lower-left corner, press ENTER to display more information, and to return to command-line interaction mode, press CTRL + C.
Help (' OS ')
See the Help documentation and introduction to Python libraries, functions, and modules with the cmd command