skip to main
|
skip to sidebar
Sep 12, 2011
Iteration in python 3
参见 dive in python 3
Python 3 支持 iteration.
iter(a) 调用 a.__iter__() 返回一个对象b
next(b) 调用b.__next__() 返回一个需要的值
当 next(b) 抛出 StopIteration 异常,则终止循环
for n in a:
for 循环会自动按照上面所述的调用。
注意第一个值也是由 next 返回的
0 comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
Labels
algorithms
(7)
android
(3)
blackberry
(22)
blogger
(8)
c/c++
(25)
c#
(8)
computer vision
(30)
cplusplus
(25)
css
(16)
database
(4)
django
(20)
gs2
(3)
html
(10)
IC
(3)
image processing
(7)
java
(5)
javascript
(3)
knowledge
(65)
latex
(15)
lifehacks
(20)
linux
(33)
machine learning
(57)
machine vision
(4)
math
(22)
matlab
(17)
mobile
(5)
note
(9)
opencv
(4)
optimization
(13)
photography
(7)
photoshop
(2)
programming
(6)
python
(64)
R
(4)
resources
(3)
software
(31)
trouble shooting
(69)
tutorial
(83)
video coding
(9)
visual studio
(8)
WebApp
(21)
wxwidgets
(5)
Blog Archive
►
2013
(1)
►
March
(1)
►
2012
(44)
►
December
(6)
►
November
(7)
►
October
(1)
►
September
(2)
►
July
(6)
►
June
(5)
►
May
(5)
►
April
(2)
►
March
(3)
►
February
(3)
►
January
(4)
▼
2011
(100)
►
December
(9)
►
November
(4)
▼
September
(6)
file in python
python 读写 matlab mat
Matlab 图保嵌入 latex
Iteration in python 3
台式机/笔记本/上网本功耗
如何通过使用 Sc.exe 创建 Windows 服务
►
July
(10)
►
June
(31)
►
May
(11)
►
April
(12)
►
March
(2)
►
January
(15)
►
2010
(110)
►
December
(25)
►
November
(15)
►
October
(10)
►
September
(6)
►
August
(6)
►
July
(5)
►
June
(8)
►
May
(7)
►
April
(3)
►
March
(19)
►
February
(1)
►
January
(5)
►
2009
(222)
►
December
(3)
►
November
(4)
►
October
(8)
►
September
(28)
►
August
(19)
►
July
(10)
►
June
(25)
►
May
(34)
►
April
(40)
►
March
(36)
►
February
(9)
►
January
(6)
►
2008
(17)
►
December
(15)
►
November
(2)
My List
My Life
My Space
0 comments:
Post a Comment