• 技术文章 >后端开发 >Python教程

    python中怎么查看内置函数

    爱喝马黛茶的安东尼爱喝马黛茶的安东尼2019-06-25 16:44:17原创3279
    内置函数,一般都是因为使用频率比较频繁或是是元操作,所以通过内置函数的形式提供出来,通过对python的内置函数分类分析可以看出来:基本的数据操作基本都是一些数学运算(当然除了加减乘除)、逻辑操作、集合操作、基本IO操作,然后就是对于语言自身的反射操作,还有就是字符串操作,也是比较常用的,尤其需要注意的是反射操作。

    Python解释器内置了很多函数和类型,您可以在任何时候使用它们。以下按字母表顺序列出它们。

    1561451822(1).png

    经常调用的时候不知道python当前版本的内置函数是哪些,可以用下面的指令查看:

    相关推荐:《Python视频教程

    C:\Users\Administrator>python
    Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec  5 2015, 20:32:19) [MSC v.1500 32 bit (
    Intel)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import sys
    >>> dir(sys.modules['__builtin__'])
    ['ArithmeticError', 'AssertionError', 'AttributeError', 'BaseException', 'BufferError', 'BytesWarning',
     'DeprecationWarning', 'EOFError', 'Ellipsis', 'EnvironmentError', 'Exception', 'False', 'FloatingPointError',
     'FutureWarning', 'GeneratorExit', 'IOError', 'ImportError', 'ImportWarning', 'IndentationError', 'IndexError',
     'KeyError', 'KeyboardInterrupt', 'LookupError', 'MemoryError', 'NameError','None', 'NotImplemented',
     'NotImplementedError', 'OSError', 'OverflowError', 'PendingDeprecationWarning', 'ReferenceError', 'RuntimeError',
     'RuntimeWarning', 'StandardError', 'StopIteration', 'SyntaxError', 'SyntaxWarning', 'SystemError','SystemExit', 
     'TabError', 'True', 'TypeError', 'UnboundLocalError', 'UnicodeDecodeError', 'UnicodeEncodeError', 'UnicodeError',
     'UnicodeTranslateError', 'UnicodeWarning', 'UserWarning', 'ValueError', 'Warning', 'WindowsError',
     'ZeroDivisionError', '__debug__', '__doc__', '__import__', '__name__', '__package__', 'abs','all', 'any', 
     'apply', 'basestring', 'bin', 'bool', 'buffer', 'bytearray', 'bytes', 'callable', 'chr', 'classmethod', 'cmp',
     'coerce', 'compile', 'complex', 'copyright', 'credits', 'delattr', 'dict', 'dir', 'divmod', 'enumerate',
     'eval', 'execfile', 'exit', 'file', 'filter', 'float', 'format', 'frozenset', 'getattr', 'globals',
     'hasattr', 'hash', 'help', 'hex', 'id', 'input', 'int', 'intern', 'isinstance', 'issubclass', 'iter',
     'len', 'license', 'list', 'locals', 'long', 'map', 'max', 'memoryview', 'min', 'next', 'object', 'oct',
     'open', 'ord', 'pow', 'print', 'property', 'quit', 'range', 'raw_input', 'reduce', 'reload', 'repr',
     'reversed', 'round', 'set', 'setattr', 'slice', 'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple',
     'type', 'unichr', 'unicode', 'vars', 'xrange', 'zip']

    以上就是python中怎么查看内置函数的详细内容,更多请关注php中文网其它相关文章!

    声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。
    专题推荐:python 内置函数
    上一篇:python怎么单步调试 下一篇:python开发工程师是做什么的
    php培训_php实战培训【立即报名】-php中文网第20期

    相关文章推荐

    • 【活动】充值PHP中文网VIP即送云服务器• python怎么print出共轭复数• python函数重写怎么理解• 为什么python慢• python怎么单步调试
    1/1

    PHP中文网