python常用的标准库以及第三方库有哪些?

回复内容:
只介绍我用过觉得有强烈推荐欲望的几个=====================标准库* http://docs.python.org/library/argparse.html 写命令行脚本必备,可惜是2.7才添加的,得看具体环境了…* http://docs.python.org/library/htmlparser.html 解析html dom树,偶尔搞搞命令行自动表单提交用得上。感觉不好用但是毕竟是官方库=====================第三方库* http://pypi.python.org/pypi/sh 简直是系统管理神器,谁用谁知道* http://pypi.python.org/pypi/suds 轻量的soap客户端,如果贵厂内部有用soap接口,那这个几乎是必须了* http://pypi.python.org/pypi/requests 这个http lib的名字叫python http for human。用过urllib、urllib2、httplib的人,你懂的* http://pypi.python.org/pypi/pelican* http://pypi.python.org/pypi/markdoc 前者是静态博客生成器(写markdown文本,然后自动转换成html静态文件),后者是文档生成器(以前拿这个做wiki用)* http://pypi.python.org/pypi/pep8 检查python脚本是否符合pep8的style guide* http://pypi.python.org/pypi/pygments 语法高亮的lib,很多ruby项目用的都是这个python lib来做语法高亮的其他想到了再补充吧
我也来几个吧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算法cvsjson/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 模块的 极佳选择暂时记得这么多吧,不过都是我自己常用的库 🙂 。。欢迎补充update:a curated list of awesome python frameworks, libraries and software.vinta/awesome-python · github几乎所有很赞的 python 库,和框架都在这个列表里。其他的 awesome list:bayandin/awesome-awesomeness · github
原生:系统调用的subprocess多线程的multiprocessing第三方:系统管理推荐fabric和saltweb框架推荐flask和tornadoorm推荐sqlalchemy
python资源大全 去这个地方看看,python常用模块基本都包括啦,而且还有很多学校资料
功能型的都是各取所需 就说些好用的吧tornado: 和其他python框架的架构可谓大相径庭,request的处理方式也很舒服,特别适合rest,谁用谁知道mako: 个人认为是最好的template,简单 性能好sqlalchemy: 快一统orm了吧quixote:其实还是蛮好用的pyquery: 用jquery的语法写爬虫 略爽gevent。。。。。
推荐两个 beautifulsoup 和 image
20 python libraries you can’t live withoutby yasoob •wordpress.com • july 30, 2013

hi there fellas. today i am going to list 20 python libraries which have been a part of my toolbelt and should be a part of yours as well. so here they are:

1.requests. the most famous http library written by kenneth reitz. it’s a must have for every python developer.

2.scrapy. if you are involved in webscraping then this is a must have library for you. after using this library you won’t use any other.

3.wxpython. a gui toolkit for python. i have primarily used it in place of tkinter. you will really love it.

4.pillow. a friendly fork of pil (python imaging library). it is more user friendly than pil and is a must have for anyone who works with images.

5.sqlalchemy. a database library. many love it and many hate it. the choice is yours.

6.beautifulsoup. i know it’s slow but this xml and html parsing library is very useful for beginners.

7.twisted. the most important tool for any network application developer. it has a very beautiful api and is used by a lot of famous python developers.

8.numpy. how can we leave this very important library ? it provides some advance math functionalities to python.

9.scipy. when we talk about numpy then we have to talk about scipy. it is a library of algorithms and mathematical tools for python and has caused many scientists to switch from ruby to python.

10.matplotlib. a numerical plotting library. it is very useful for any data scientist or any data analyzer.

11.pygame. which developer does not like to play games and develop them ? this library will help you achieve your goal of 2d game development.

12.pyglet. a 3d animation and game creation engine. this is the engine in which the famous python port of minecraft was made

13.pyqt. a gui toolkit for python. it is my second choice after wxpython for developing gui’s for my python scripts.

14.pygtk. another python gui library. it is the same library in which the famous bittorrent client is created.

15.scapy. a packet sniffer and analyzer for python made in python.

16.pywin32. a python library which provides some useful methods and classes for interacting with windows.

17.nltk. natural language toolkit – i realize most people won’t be using this one, but it’s generic enough. it is a very useful library if you want to manipulate strings. but it’s capacity is beyond that. do check it out.

18.nose. a testing framework for python. it is used by millions of python developers. it is a must have if you do test driven development.

19.sympy. sympy can do algebraic evaluation, differentiation, expansion, complex numbers, etc. it is contained in a pure python distribution.

20.ipython. i just can’t stress enough how useful this tool is. it is a python prompt on steroids. it has completion, history, shell capabilities, and a lot more. make sure that you take a look at it.

https://freepythontips.wordpress.com/2013/07/30/20-python-libraries-you-cant-live-without/
requests 好用的让人想哭
一个memo: https://github.com/fengsp/easy-python或者直接: http://easy-python.readthedocs.org/
我也来说两个:操作系统相关的os库python程序本身相关的sys库配置文件解析的configparser库redis python客户端pyredis另外还有itertool,subprocess等web框架:web.py flask django

Posted in 未分类

发表评论