Python模块和函数的快速查看
2012-12-03 17:01
274 查看
如果想查看某个模块提供了哪些函数等,我们可以进入python控制台,然后导入模块,再使用help(模块名)来查看这个模块的功能有哪些。
以string模块为例:
>>> import string
>>> help(string)
Help on module string:
NAME
string - A collection of string operations (most are no longer used).
FILE
/usr/lib/python2.7/string.py
MODULE DOCS http://docs.python.org/library/string
DESCRIPTION
Warning: most of the code you see here isn't normally used nowadays.
Beginning with Python 1.6, many of these functions are implemented as
methods on the standard string object. They used to be implemented by
a built-in module called strop, but strop is now obsolete itself.
Public module variables:
whitespace -- a string containing all characters considered whitespace
lowercase -- a string containing all characters considered lowercase letters
uppercase -- a string containing all characters considered uppercase letters
letters -- a string containing all characters considered letters
:
如果想查看某一个具体的函数,可以使用help(函数名):
>>>help(format)
Help on built-in function format in module __builtin__:
format(...)
format(value[, format_spec]) -> string
Returns value.__format__(format_spec)
format_spec defaults to ""
以string模块为例:
>>> import string
>>> help(string)
Help on module string:
NAME
string - A collection of string operations (most are no longer used).
FILE
/usr/lib/python2.7/string.py
MODULE DOCS http://docs.python.org/library/string
DESCRIPTION
Warning: most of the code you see here isn't normally used nowadays.
Beginning with Python 1.6, many of these functions are implemented as
methods on the standard string object. They used to be implemented by
a built-in module called strop, but strop is now obsolete itself.
Public module variables:
whitespace -- a string containing all characters considered whitespace
lowercase -- a string containing all characters considered lowercase letters
uppercase -- a string containing all characters considered uppercase letters
letters -- a string containing all characters considered letters
:
如果想查看某一个具体的函数,可以使用help(函数名):
>>>help(format)
Help on built-in function format in module __builtin__:
format(...)
format(value[, format_spec]) -> string
Returns value.__format__(format_spec)
format_spec defaults to ""
相关文章推荐
- Python模块和函数的快速查看
- 查看Python包模块中的函数
- Python学习笔记(三):Time、函数、模块、文件I/O、异常处理(快速入门篇)
- Python模块和函数帮助文档查看
- python的系统模块builtins快速查看
- python查看模块,对象的函数方法
- python查看模块,对象的函数
- 查看python的模块和函数帮助文档方法
- 函数知识及文件IO操作(python快速入门精华切记03)
- Python-----PIL Image模块 show函数不能正常显示图片
- python os.path模块函数中文说明
- 【python】如何批量读取文件夹的所有文件数据,os模块与open函数结合使用实例
- Python3开发(1)基础快速入门(适用于有其他编程语言基础查看)
- Python中functools模块的常用函数解析
- Python Json模块中dumps、loads、dump、load函数介绍
- python 发送邮件函数模块
- Python中threading模块的join函数
- python快速入门(6)函数
- Python里的OS模块常用函数说明
- Python 函数、文件与模块