只介绍我用过觉得有强烈推荐欲望的几个=====================标准库* 写命令行脚本必备,可惜是2.7才添加的,得看具体环境了…* 解析html dom树,偶尔搞搞命令行自动表单提交用得上。感觉不好用但是毕竟是官方库=====================第三方库* 简直是系统管理神器,谁用谁知道* 轻量的soap客户端,如果贵厂内部有用soap接口,那这个几乎是必须了* 这个http lib的名字叫python http for human。用过urllib、urllib2、httplib的人,你懂的** 前者是静态博客生成器(写markdown文本,然后自动转换成html静态文件),后者是文档生成器(以前拿这个做wiki用)* 检查python脚本是否符合pep8的style guide* 语法高亮的lib,很多ruby项目用的都是这个python lib来做语法高亮的其他想到了再补充吧
我也来几个吧standard libs:itertools 学好python有必要掌握上面这两个库吧,re 正则subprocess 调用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 ssh python 库selenium 浏览器自动化测试工具selenium的python 接口lxml python 解析html,xml 的神器mechanize stateful programmatic web browsingpycurl curl library module for pythonfabric 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 xml 转 dict,真心好用urllib3 和 requests: 当然其实requests就够了 requests: http for humansflask web 微框架 ipdb 调试神器,同时推荐ipython!结合ipython使用redis redis python接口pymongo mongodbpython接口pil python图像处理mako python模版引擎numpy , scipy 科学计算matplotlib 画图scrapy 爬虫django/tornado/等等 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
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 • • 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.
requests 好用的让人想哭
我也来说两个:操作系统相关的os库python程序本身相关的sys库配置文件解析的configparser库redis python客户端pyredis另外还有itertool,subprocess等web框架 flask django

Posted in 未分类