python的系统模块builtins快速查看

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python的系统模块builtins快速查看相关的知识,希望对你有一定的参考价值。

python是简单的一门语言,是因为里面存在了很多的模块使用,就好如linux中的也有理解命令的使用“man”、“help”,而python也有。

用下面的命令查看>>> dir(__builtins__)

>>> dir(__builtins__)

[‘ArithmeticError‘, ‘AssertionError‘, ‘AttributeError‘, ‘BaseException‘, ‘BlockingIOError‘, ‘BrokenPipeError‘, ‘BufferError‘, ‘BytesWarning‘, ‘ChildProcessError‘, ‘ConnectionAbortedError‘, ‘ConnectionError‘, ‘ConnectionRefusedError‘, ‘ConnectionResetError‘, ‘DeprecationWarning‘, ‘EOFError‘, ‘Ellipsis‘, ‘EnvironmentError‘, ‘Exception‘, ‘False‘, ‘FileExistsError‘, ‘FileNotFoundError‘, ‘FloatingPointError‘, ‘FutureWarning‘, ‘GeneratorExit‘, ‘IOError‘, ‘ImportError‘, ‘ImportWarning‘, ‘IndentationError‘, ‘IndexError‘, ‘InterruptedError‘, ‘IsADirectoryError‘, ‘KeyError‘, ‘KeyboardInterrupt‘, ‘LookupError‘, ‘MemoryError‘, ‘NameError‘, ‘None‘, ‘NotADirectoryError‘, ‘NotImplemented‘, ‘NotImplementedError‘, ‘OSError‘, ‘OverflowError‘, ‘PendingDeprecationWarning‘, ‘PermissionError‘, ‘ProcessLookupError‘, ‘ReferenceError‘, ‘ResourceWarning‘, ‘RuntimeError‘, ‘RuntimeWarning‘, ‘StopIteration‘, ‘SyntaxError‘, ‘SyntaxWarning‘, ‘SystemError‘, ‘SystemExit‘, ‘TabError‘, ‘TimeoutError‘, ‘True‘, ‘TypeError‘, ‘UnboundLocalError‘, ‘UnicodeDecodeError‘, ‘UnicodeEncodeError‘, ‘UnicodeError‘, ‘UnicodeTranslateError‘, ‘UnicodeWarning‘, ‘UserWarning‘, ‘ValueError‘, ‘Warning‘, ‘WindowsError‘, ‘ZeroDivisionError‘, ‘__build_class__‘, ‘__debug__‘, ‘__doc__‘, ‘__import__‘, ‘__loader__‘, ‘__name__‘, ‘__package__‘, ‘__spec__‘, ‘abs‘, ‘all‘, ‘any‘, ‘ascii‘, ‘bin‘, ‘bool‘, ‘bytearray‘, ‘bytes‘, ‘callable‘, ‘chr‘, ‘classmethod‘, ‘compile‘, ‘complex‘, ‘copyright‘, ‘credits‘, ‘delattr‘, ‘dict‘, ‘dir‘, ‘divmod‘, ‘enumerate‘, ‘eval‘, ‘exec‘, ‘exit‘, ‘filter‘, ‘float‘, ‘format‘, ‘frozenset‘, ‘getattr‘, ‘globals‘, ‘hasattr‘, ‘hash‘, ‘help‘, ‘hex‘, ‘id‘, ‘input‘, ‘int‘, ‘isinstance‘, ‘issubclass‘, ‘iter‘, ‘len‘, ‘license‘, ‘list‘, ‘locals‘, ‘map‘, ‘max‘, ‘memoryview‘, ‘min‘, ‘next‘, ‘object‘, ‘oct‘, ‘open‘, ‘ord‘, ‘pow‘, ‘print‘, ‘property‘, ‘quit‘, ‘range‘, ‘repr‘, ‘reversed‘, ‘round‘, ‘set‘, ‘setattr‘, ‘slice‘, ‘sorted‘, ‘staticmethod‘, ‘str‘, ‘sum‘, ‘super‘, ‘tuple‘, ‘type‘, ‘vars‘, ‘zip‘]

这些都是python的系统模块

想查询命令意思:>>> help (input)

>>> help (input)

Help on built-in function input in module builtins:


input(...)

    input([prompt]) -> string

    

    Read a string from standard input.  The trailing newline is stripped.

    If the user hits EOF (Unix: Ctl-D, Windows: Ctl-Z+Return), raise EOFError.

    On Unix, GNU readline is used if enabled.  The prompt string, if given,

    is printed without a trailing newline before reading.

然后你就可以去谷歌或者百度查查你想查的命令。


本文出自 “10816833” 博客,请务必保留此出处http://10826833.blog.51cto.com/10816833/1795104

以上是关于python的系统模块builtins快速查看的主要内容,如果未能解决你的问题,请参考以下文章

ps 备忘清单_开发速查表分享

CentOS快速查看系统日志(干货,建议收藏)

python如何查看内置函数

python __builtin__模块介绍

python附录-builtins.py模块str类源码(含str官方文档链接)

Python语法速查: 20. 线程与并发