Very basic question - how to get one value from a generator in Python?
So far I found I can get one by writing gen.next(). I just want to make sure this
gen.next()
This is the correct way to do it.
You can also use next(gen).
next(gen)
http://docs.python.org/library/functions.html#next