This code is from http://docs.python.org/2/tutorial/errors.html#predefined-clean-up-actions
with open(\"myfile.txt\") as f: for line in f: print
in python 2.7:
print line,
in python 3.x:
print(line, end = ' ')