python常用库

作者:atupal
链接:https://www.zhihu.com/question/20501628/answer/19542741
来源:知乎
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

standard libs:itertools http://docs.python.org/2/library/itertools.htmlfunctools http://docs.python.org/2/library/functools.html 学好python有必要掌握上面这两个库吧,
re 正则
subprocess http://docs.python.org/2/library/subprocess.html 调用shell命令的神器
pdb 调试
traceback 调试
pprint 漂亮的输出
logging 日志
threading和multiprocessing 多线程
urllib/urllib2/httplib http库,httplib底层一点,推荐第三方的库requestsos/sys 系统,环境相关
Queue 队列
pickle/cPickle 序列化工具
hashlib md5, sha等hash算法
cvs
json/simplejson python的json库,据so上的讨论和benchmark,simplejson的性能要高于jsontimeit 计算代码运行的时间等等cProfile python性能测量模块glob 类似与listfile,可以用来查找文件atexit 有一个注册函数,可用于正好在脚本退出运行前执行一些代码
dis python 反汇编,当对某条语句不理解原理时,可以用dis.dis 函数来查看代码对应的python 解释器指令等等。
3th libs:paramiko https://github.com/paramiko/paramiko ssh python 库selenium https://pypi.python.org/pypi/selenium 浏览器自动化测试工具selenium的python 接口lxml http://lxml.de/ python 解析html,xml 的神器mechanize https://pypi.python.org/pypi/mechanize/ Stateful programmatic web browsingpycurl https://pypi.python.org/pypi/pycurl cURL library module for PythonFabric http://docs.fabfile.org/en/1.8/ Fabric is a Python (2.5 or higher) library and command-line tool for streamlining the use of SSH for application deployment or systems administration tasks.xmltodict https://github.com/martinblech/xmltodict xml 转 dict,真心好用urllib3 和 requests: 当然其实requests就够了 Requests: HTTP for Humansflask http://flask.pocoo.org/python web 微框架 ipdb 调试神器,同时推荐ipython!结合ipython使用redis redis python接口pymongo mongodbpython接口PIL http://www.pythonware.com/products/pil/ python图像处理mako http://www.makotemplates.org/ python模版引擎numpy , scipy 科学计算matplotlib 画图scrapy 爬虫django/tornado/web.py/web2py/uliweb/flask/twisted/bottle/cherrypy.等等 python web框架/服务器sh 1.08 — sh v1.08 documentation 用来运行shell 模块的 极佳选择

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值