A detailed introduction to Python's built-in Help function

Source: Internet
Author: User
English Documents:

help([object])

Invoke the built-in Help system. (This function is intended-interactive use.) If no argument is given, the interactive Help system starts on the interpreter console. If The argument is a string and then the string was looked up as the name of a module, function, class, method, keyword, or do Cumentation topic, and a help page are printed on the console. If The argument is a and kind of object, a help page to the object is generated.

This function was added to the built-in namespace by the site module.

Description

1. In the interpreter interface, when the function is called without arguments, the built-in Help system is activated and enters the Help system. When you enter names for modules, classes, functions, and so on inside the help system, their usage instructions are displayed, input quit exits the built-in Help system, and returns to the interactive interface.

>>> Help () #不带参数Welcome to Python 3.5 's help utility! If This is your first time using Python, you should 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". #进入内置帮助系统 >>&gt ;  became help>help> str #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 and then the object must expose a data buFfer | That'll 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 #不存在的模块名, 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 #退出内置帮助系统You is now leaving help and returning to the Python Interp Reter.  If you want to ask for help on a particular object directly from Theinterpreter, you can type ' help (object) '. Executing "help (' string ')" have the same effect as typing a particular string at the Help> prompt.# have exited the built-in helper system, return to interactive interface helps > into >>>>>>

2. In the interpreter interface, when an incoming parameter invokes a function, it looks for the module name, the class name, the function name, and, if so, its usage instructions.

>>> 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 and then the object must expose a data buffer |  That'll 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. |    ***************************

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.