How to read .txt file

自闭症网瘾萝莉.ら 提交于 2019-12-13 09:37:00

问题


I'm in need of your help. I have a .txt file and I want to print all the texts using Python 2.7.

I've used this code which is shown below. But it is not showing any text except errors.

file = open('x.txt' , 'r')
print file.read

Now, what to do?

Thanking you in advance.

来源:https://stackoverflow.com/questions/22440949/how-to-read-txt-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!