1、read
将整个文件读取成一个字符串
2、f
for line in f:
每次读取一行
3、readline
line = f.readline()while line: print(line.strip()) line = f.readline()
4、readlines
for line in f.readlines(): print(line.strip())