查看python 3中的内置函数列表,以及函数功能描述

  1 >>> dir(__builtins__)//查看内置函数(BIF)列表
  2 ['ArithmeticError', 'AssertionError', 'AttributeError',
  3  'BaseException', 'BlockingIOError', 'BrokenPipeError', 'BufferError', 'BytesWarning',
  4  'ChildProcessError', 'ConnectionAbortedError', 'ConnectionError', 'ConnectionRefusedError', 'ConnectionResetError', 
  5 'DeprecationWarning',
  6  'EOFError', 'Ellipsis', 'EnvironmentError', 'Exception', 
  7 'False', 'FileExistsError', 'FileNotFoundError', 'FloatingPointError', 'FutureWarning',
  8  'GeneratorExit',
  9  'IOError', 'ImportError', 'ImportWarning', 'IndentationError', 'IndexError', 'InterruptedError', 'IsADirectoryError',
 10  'KeyError', 'KeyboardInterrupt',
 11  'LookupError', 
 12 'MemoryError',  13 NameError', 'None', 'NotADirectoryError', 'NotImplemented', 'NotImplementedError',
 14  'OSError', 'OverflowError',
 15  'PendingDeprecationWarning', 'PermissionError', 'ProcessLookupError',
 16  'RecursionError', 'ReferenceError', 'ResourceWarning', 'RuntimeError', 'RuntimeWarning', 
 17 'StopAsyncIteration', 'StopIteration', 'SyntaxError', 'SyntaxWarning', 'SystemError', 'SystemExit',
 18  'TabError', 'TimeoutError', 'True', 'TypeError',
 19  'UnboundLocalError', 'UnicodeDecodeError', 'UnicodeEncodeError', 'UnicodeError', 'UnicodeTranslateError', 'UnicodeWarning', 'UserWarning', 
 20 'ValueError', 
 21 'Warning', 'WindowsError',
 22  'ZeroDivisionError',
 23  '_', '__build_class__', '__debug__', '__doc__', '__import__', '__loader__', '__name__', '__package__', '__spec__',
 24  'abs', 'all', 'any', 'ascii',
 25  'bin', 'bool', 'bytearray', 'bytes',
 26  'callable', 'chr', 'classmethod', 'compile', 'complex', 'copyright', 'credits',
 27  'delattr', 'dict', 'dir', 'divmod', 
 28 'enumerate', 'eval', 'exec', 'exit',
 29  'filter', 'float', 'format', 'frozenset',
 30  'getattr', 'globals',
 31  'hasattr', 'hash', 'help', 'hex',
 32  'id', 'input', 'int', 'isinstance', 'issubclass', 'iter',
 33  'len', 'license', 'list', 'locals',
 34  'map', 'max', 'memoryview', 'min',
 35  'next',
 36  'object', 'oct', 'open', 'ord', 
 37 'pow', 'print', 'property',
 38  'quit',
 39  'range', 'repr', 'reversed', 'round',
 40  'set', 'setattr', 'slice', 'sorted', 'staticmethod', 'str', 'sum', 'super',
 41  'tuple', 'type',
 42  'vars',
 43  'zip']
 44 >>> help(input)//查看内置函数(BIF)功能描述
 45 Help on built-in function input in module builtins:
 46 
 47 input(prompt=None, /)
 48     Read a string from standard input.  The trailing newline is stripped.
 49     
 50     The prompt string, if given, is printed to standard output without a
 51     trailing newline before reading input.
 52     
 53     If the user hits EOF (*nix: Ctrl-D, Windows: Ctrl-Z+Return), raise EOFError.
 54     On *nix systems, readline is used if available.
 55 
 56 >>> help(range)
 57 Help on class range in module builtins:
 58 
 59 class range(object)
 60  |  range(stop) -> range object
 61  |  range(start, stop[, step]) -> range object
 62  |  
 63  |  Return an object that produces a sequence of integers from start (inclusive)
 64  |  to stop (exclusive) by step.  range(i, j) produces i, i+1, i+2, ..., j-1.
 65  |  start defaults to 0, and stop is omitted!  range(4) produces 0, 1, 2, 3.
 66  |  These are exactly the valid indices for a list of 4 elements.
 67  |  When step is given, it specifies the increment (or decrement).
 68  |  
 69  |  Methods defined here:
 70  |  
 71  |  __contains__(self, key, /)
 72  |      Return key in self.
 73  |  
 74  |  __eq__(self, value, /)
 75  |      Return self==value.
 76  |  
 77  |  __ge__(self, value, /)
 78  |      Return self>=value.
 79  |  
 80  |  __getattribute__(self, name, /)
 81  |      Return getattr(self, name).
 82  |  
 83  |  __getitem__(self, key, /)
 84  |      Return self[key].
 85  |  
 86  |  __gt__(self, value, /)
 87  |      Return self>value.
 88  |  
 89  |  __hash__(self, /)
 90  |      Return hash(self).
 91  |  
 92  |  __iter__(self, /)
 93  |      Implement iter(self).
 94  |  
 95  |  __le__(self, value, /)
 96  |      Return self<=value.
 97  |  
 98  |  __len__(self, /)
 99  |      Return len(self).
100  |  
101  |  __lt__(self, value, /)
102  |      Return self<value.
103  |  
104  |  __ne__(self, value, /)
105  |      Return self!=value.
106  |  
107  |  __new__(*args, **kwargs) from builtins.type
108  |      Create and return a new object.  See help(type) for accurate signature.
109  |  
110  |  __reduce__(...)
111  |      helper for pickle
112  |  
113  |  __repr__(self, /)
114  |      Return repr(self).
115  |  
116  |  __reversed__(...)
117  |      Return a reverse iterator.
118  |  
119  |  count(...)
120  |      rangeobject.count(value) -> integer -- return number of occurrences of value
121  |  
122  |  index(...)
123  |      rangeobject.index(value, [start, [stop]]) -> integer -- return index of value.
124  |      Raise ValueError if the value is not present.
125  |  
126  |  ----------------------------------------------------------------------
127  |  Data descriptors defined here:
128  |  
129  |  start
130  |  
131  |  step
132  |  
133  |  stop

 

posted @ 2016-07-30 07:40  月色深潭  阅读(6511)  评论(0编辑  收藏  举报