Python built-in functions (29) -- help, python built-in 29 help

Source: Internet
Author: User

Python built-in functions (29) -- help, python built-in 29 help

English document:

help([Object])

Invoke the built-in help system. (This function is intended for interactive use .) if no argument is given, the interactive help system starts on the interpreter console. if the argument is a string, then the string is looked up as the name of a module, function, class, method, keyword, or documentation topic, and a help page is printed on the console. if the argument is any other kind of object, a help page on the object is generated.

This function is added to the built-in namespace bysiteModule.

 

Note:

1. In the interpreter interaction interface, when a function is called without passing parameters, the built-in help system is activated and the help system is entered. When you enter the module, class, function, and other names in the Help System, the instructions are displayed. Enter quit to exit the built-in help system and return to the interactive interface.

>>> Help () # do not include the parameter Welcome to Python 3.5's help utility! If this is your first time using Python, you shoshould definitely check outthe tutorial on the Internet at http://docs.python.org/3.5/tutorial/.Enter the name of any module, keyword, or topic to get help on writingPython programs and using Python modules. to quit this help utility andreturn to the interpreter, just type "quit ". to get a list of available modules, keywords, symbols, or topics, type "modules", "keywords", "symbols", or "topics ". each module also comeswith a one-line summary of what it does; to list the modules whose nameor summary contain a given string such as "spam", type "modules spam ". # Go to the built-in help system> to help> Help> str # help information of str on class str in module builtins: class str (object) | str (object = '')-> str | str (bytes_or_buffer [, encoding [, errors])-> str | Create a new string object from the given object. if encoding or | errors is specified, then the object must expose a data buffer | that will be decoded using the given encoding and error handler. | Otherwise, returns the result of object. _ str _ () (if defined) | or repr (object ). | encoding defaults to sys. getdefaultencoding (). | errors defaults to 'strict '. | Methods defined here: | _ add _ (self, value ,/) | Return self + value ................................. help> 1 # nonexistent Module name, class name, function name No Python documentation found for '1 '. use help () to get the interactive help utility. use help (str) for help on the str class. help> quit # exit the built-in help system You are now leaving help and returning to the Python interpreter. if you want to ask for help on a particle object directly from theinterpreter, you can type "help (object )". executing "help ('string')" has the same effect as typing a participant string at the help> prompt. # exit the built-in help system and return to the interactive interface help> to >>>>>

2. On the interpreter interaction interface, when you pass in a parameter to call a function, you will find whether the parameter is a module name, class name, or function name. If yes, its usage instructions are displayed.

>>> help(str) Help on class str in module builtins:class str(object) |  str(object='') -> str |  str(bytes_or_buffer[, encoding[, errors]]) -> str |   |  Create a new string object from the given object. If encoding or |  errors is specified, then the object must expose a data buffer |  that will be decoded using the given encoding and error handler. |  Otherwise, returns the result of object.__str__() (if defined) |  or repr(object). |  encoding defaults to sys.getdefaultencoding(). |  errors defaults to 'strict'. |   |  Methods defined here: |   |  __add__(self, value, /) |      Return self+value. |    ***************************

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.