Context managers: with (file) experiments
with open('out.txt', 'w') as h:
h.write("hello\n")
h = open('out.txt')
print(h.read())
f = open('out.txt', 'w')
f.write("hello\n")
f.close()
# for line in open("myfile.txt"):
# print line,
# the file is closed only when script ends