#读取文件所有内容,返回字符串对象,python默认以文本方式读取文件,遇到结束符读取结束. fr = open('lenses.txt')read = fr.read()print(type(read),read) #读取文件中的一行,每次读取一行,返回字符串对象,只要该文件打开,下次读取上次的下一行. fr = open('lenses.txt')read = fr.readline()print(type(read),read) read2 = fr.readline()print(typ…