python标准库
2015-10-26 15:35
585 查看
import copy print [item for item in dir(copy) if not item.startswith('_')] print "*"*50 for i in dir(copy):#查看模块包含的内容 print i print "*"*50 print copy.__all__#定义模块公共接口 使用语句from copy import *将会倒入该语句打印出的函数函数 print "*"*50 print help(copy.copy)#获取帮助 print "*"*50 print range.__doc__#查找函数的描述 print "*"*50 print copy.__file__#文件路径 print "**********Done!Tada!!**********"
如上所示,可以对标准库进行一些查看,输出结果如下:
['Error', 'PyStringMap', 'copy', 'deepcopy', 'dispatch_table', 'error', 'name', 't', 'weakref']
**************************************************
Error
PyStringMap
...(省略若干行)
name
t
weakref
**************************************************
['Error', 'copy', 'deepcopy']
**************************************************
Help on function copy in module copy:
copy(x)
Shallow copy operation on arbitrary Python objects.
See the module's __doc__ string for more info.
None
**************************************************
range(stop) -> list of integers
range(start, stop[, step]) -> list of integers
Return a list containing an arithmetic progression of integers.
range(i, j) returns [i, i+1, i+2, ..., j-1]; start (!) defaults to 0.
When step is given, it specifies the increment (or decrement).
For example, range(4) returns [0, 1, 2, 3]. The end point is omitted!
These are exactly the valid indices for a list of 4 elements.
**************************************************
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.pyc
**********Done!Tada!!**********下面简单介绍几个标准库:
第一个,踏哒,sys->这个模块让你能够访问于python解释器紧密联系的变量和函数
os模块提供了访问多个操作系统服务的功能
fileinput模块让你能够轻松的遍历文本文件的所有行
time模块:获得当前时间、操作时间和日期、从字符串读取日期以及格式化日期为字符串
radom模块包括返回随机数的函数
re模块包含对正则表达式的支持
相关文章推荐
- Python偏函数
- 【LeetCode】【Python解决问题的方法】Best Time to Buy and Sell Stock II
- Python语言下的机器学习库
- 以Python代码实例展示kNN算法的实际运用
- python装饰器
- 从Theano到Lasagne:基于Python的深度学习的框架和库
- tkinter Label标签相关
- Python WMI获取Windows系统信息 监控系统
- Python学习资源
- python 包管理
- python Synchronization between processes
- Python二维码生成库qrcode安装和使用示例
- Python点点滴滴积累---getopt使用(详解)
- python之报错的解决(持续总结)
- Python基础(十)正则表达式
- Python 深入理解yield
- tornado 学习笔记2 Python web主流框架
- tkinter 学习笔记
- python的一些日期处理方法(工具)
- python集合