On this page... (hide)
- 1. Pyfan
- 2. About Python
- 2.1 Good editor
- 3. Syntax
- 3.1 yield
1. Pyfan
PyFan(派饭?)是一个给fanfou写的Python脚本,最大的特点就是支持抓取20条消息之前的内容。
2. About Python
Python 是一门脚本语言。很好,很强大。
- 简明 Python 教程 Python的入门
- 深入 Python :Dive Into Python 中文版 为有经验的程序员写的一本书
2.1 Good editor
Use VIM
http://blog.csdn.net/changemyself/archive/2007/07/23/1703642.aspx
3. Syntax
3.1 yield
yield 是一个程序迭代生成器,相当于给程序代码添加一个next()属性。
#!/usr/bin/env python
def gen(a):
while a:
# print "P", a
a = a - 1
yield a
for i in gen(10):
print i
def gen(a):
while a:
# print "P", a
a = a - 1
yield a
for i in gen(10):
print i
参考资料
