读取文本文件时语法错误无效

时间:2014-05-08 20:41:58

标签: printing

尝试写作和阅读。 文本写在文件中,但在阅读时我得到"无效的语法"在打印线上: 谢谢

text_file = open ("write_to_file.txt", "w")

t = input( "enter name ")
a = input ("address ")
enter code here`n =input ("number ")
text_file.write(t)
text_file.write(a)
text_file.write(n)
text_file.close()

text_file = open("write_to_file.txt", "r")
print text_file.read()
text_file.close()

0 个答案:

没有答案