我们经常用python读取文件信息,这里有些注意事项 with open('test.txt', 'r') as f: print 'f.read', f.read() with open('test.txt', 'r') as f: print 'f.readline', f.readline() with open('test.txt', 'r') as f: print 'f.readlines', f.readlines() read方法读取所有的文件内容,返回一个字符串.可用指定读取的…