【发布时间】:2009-04-01 14:36:46
【问题描述】:
在没有收到下一项的情况下循环迭代是一种常见的编程任务。例如:
for sLine in oFile :
if ... some logic ... :
sLine = oFile.next()
... some more logic ...
# at this point i want to continue iteration but without
# getting next item from oFile. How can this be done in python?
【问题讨论】:
-
-1:这令人费解。也许你想要一个“GOTO”?或者您可能需要定义一些可以重复使用的函数来避免这种人为的循环?