C++ like iterators in python?
- by uberjumper
This might be a really dumb question, however i've looked around online, etc. And have not seen a solid answer.
What i was wondering, is there a simple way to do something like this?
lines = open('something.txt', 'r').readlines()
for line in lines:
if line == '!':
# force iteration forward twice
line.next().next()
<etc>
Is there an easy way to do that in python?