您的位置:首页 > 移动开发 > Objective-C

Python 内建函数 - help([object])

2017-03-16 09:32 344 查看
Manual

直译

实例

拓展阅读

Manual

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 by the site module.

Changed in version 3.4: Changes to pydoc and inspect mean that the reported signatures for callables are now more comprehensive and consistent.

直译

援引内建帮助系统(该函数目的是为了交互式使用)。如果未给定参数,则在解释器控制台启动交互式帮助系统。如果参数是字符串,随后会根据字符串查找以此命名的模块、函数、类、方法、关键字或文档主题,并且在控制台上打印帮助页。如果参数是任意其他对象类别,会生成该对象的帮助页。该函数通过节点模块增加到内建命名空间。

version 3.4变更:pydocinspect变动意味着,调用对象的信号报告变得更全面一致。

实例

>>> import os
>>> help(os)
Help on module os:

NAME
os - OS routines for NT or Posix depending on what system we're on.

DESCRIPTION
This exports:
- all functions from posix, nt or ce, e.g. unlink, stat, etc.
- os.path is either posixpath or ntpath
- os.name is either 'posix', 'nt' or 'ce'.
- os.curdir is a string representing the current directory ('.' or ':')
- os.pardir is a string representing the parent directory ('..' or '::')
- os.sep is the (or a most common) pathname separator ('/' or ':' or '\\')
- os.extsep is the extension separator (always '.')
- os.altsep is the alternate pathname separator (None or '/')
- os.pathsep is the component separator used in $PATH etc
- os.linesep is the line separator in text files ('\r' or '\n' or '\r\n')
- os.defpath is the default search path for executables
- os.devnull is the file path of the null device ('/dev/null', etc.)

Programs that import and use 'os' stand a better chance of being
portable between different platforms.  Of course, they must then
only use functions that are defined by all platforms (e.g., unlink
and opendir), and leave all pathname manipulation to os.path
(e.g., split and join).
...
...


拓展阅读

pydoc

inspect
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  python