fout = open('tmp.txt', 'w') fout.write('asdf') fout.close() fin = open('TMP.TXT', 'r') print("The contents are:", fin.read())