from __future__ import with_statement from time import sleep i = 0 while True: print(i) i = i + 1 sleep(0.1)