with open('somefile') as openfileobject:
    for line in openfileobject:
        do_something()

"""
http://stackoverflow.com/questions/15599639/whats-perfect-counterpart-in-python-for-while-not-eof 
"""


