Added generators in python. Thanks to Yogi.