This shows you the differences between two versions of the page.
python [2015/11/13 16:55] |
python [2023/08/19 20:17] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Python 学习 ====== | ||
+ | |||
+ | ===== Python 2.6 文档 ===== | ||
+ | |||
+ | [[http://www.hejinyun.com/doc/python/|请猛击这里]] | ||
+ | |||
+ | 新手可以先看其中的 Tutorial 和 Using Python,一般需要花两天时间。平时有空浏览一下 Python HOWTOs 和 FAQs。 | ||
+ | 在实际编程过程中可以经常查阅 Library Reference 和 Language Reference。 | ||
+ | |||
+ | ===== PEPs ===== | ||
+ | |||
+ | |||
+ | PEP 在 Python 世界里的的作用类似 RFC 在 Internet 的作用。 | ||
+ | |||
+ | 目录为 PEP0: Index of Python Enhancement Proposals | ||
+ | |||
+ | 初学者一定要重点看 PEP20 和 PEP8。 | ||
+ | |||
+ | * PEP20: The Zen of Python 讲的是 Python 的设计哲学。 | ||
+ | * PEP8: Style Guide for Python Code 讲的是 Python 代码的推荐风格。 | ||
+ | |||
+ | 另外,务必在学会 Python 编程基础之后掌握列表解析、修饰符和生成器,在实际编程中很常用。 | ||
+ | |||
+ | * PEP202: List Comprehensions | ||
+ | * PEP289: Generator Expressions | ||
+ | * PEP318: Decorators for Functions and Methods | ||
+ | ===== Dive Into Python ===== | ||
+ | |||
+ | [[http://www.hejinyun.com/doc/python/diveintopython/|英文版]] | ||
+ | [[http://www.hejinyun.com/doc/python/diveintopython-zh/|中文版]] | ||
+ | |||
+ | 在看完Tutorial之后可以看这个,用于了解Python编程的一些“地道”做法。 | ||
+ | 重点看2-7章。 | ||
+ | |||
+ | ===== Python Web 开发 ===== | ||
+ | PEPs | ||
+ | |||
+ | * PEP333: Python Web Server Gateway Interface v1.0 讲的是用 Python 开发 Web 服务软件的一些接口约定规范。 | ||
+ | * PEP3333: Python Web Server Gateway Interface v1.0.1 是对 PEP333 的修订。 | ||
+ | |||
+ | 这个 PEP 看起来会有些累。要对 Python 的高级用法比较熟悉。 | ||
+ | 另外,需要了解 HTTP 协议作为基础。如果有其它语言的 Web 开发经验,则会有一定帮助。 | ||
+ | |||
+ | |||
+ | |||
+ | ===== Python 的 Web 框架和工具库 ===== | ||
+ | |||
+ | ==== django ==== | ||
+ | django是一个极为强大的网页开发框架,适合于项目的快速原型开发。但是由于各个部件耦合太紧,所以扩展性较差,比较适合中小网站。 | ||
+ | |||
+ | ==== Werkzeug ==== | ||
+ | |||
+ | [[http://werkzeug.pocoo.org/|Werkzeug]]是 URL 解析和请求/响应处理库。 | ||
+ | |||
+ | ==== Jinja 2 ==== | ||
+ | |||
+ | [[http://jinja.pocoo.org/|Jinja 2]]是一个很棒的 HTML 模板库。 | ||
+ | |||
+ | ==== Flask ==== | ||
+ | |||
+ | [[http://flask.pocoo.org/|Flask]]是 Werkzeug 和 Jinja 的开发者 pocoo 小组用 Werkzeug 和 Jinja 2 写的一个“微框架”。 | ||
+ | 可以作为大家项目的参考,也可以直接拿来用。 | ||
+ | |||
+ | ==== modwsgi ==== | ||
+ | [[http://code.google.com/p/modwsgi/|modwsgi]]是一个最近备受关注的开源apache模块。在此之前,python的程序要运行在apache容器里,主要用mod_python。但是大家发现这种支持方式很麻烦。在最近几年的进展中,python开发者逐渐开始使用mod_wsgi,使得基于该模块的开发框架也逐渐热门起来,flask就是其中之一。另外,[[https://www.djangoproject.com/|django]]也能被很好的支持。 | ||
+ | |||
+ | ==== ACRCMS ==== | ||
+ | 是一个开源的CMS,用python开发,基于[[http://www.turbogears.org/en/welcome|turbogears]] 开源python网页框架。 | ||
+ | |||
+ | ===== Python与多媒体处理 ===== | ||
+ | [[http://pymedia.org/|pymedia]] is a Python library for accessing and manipulating media files. It makes audio and video playback/creation a snap for even a newcomer to programming. This tutorial aims to walk you through installing and using the PyMedia library. | ||
+ | For the sake of simplicity most of the examples have been kept concise and straightforward. In a 'real world' application, you would need to take care of error handling, input validation and so on. | ||
+ | |||
+ | You can also try OpenCV python boundle and pylab. But for advanced user, http://www.thefoundation.de/david/2008/sep/11/using-ffmpeg-python/ are recommended. | ||
+ | |||