f.read()直接读取整个文件 f.readlines()读取整个文件,然后把每一行放到一个列表里。 f.readline()一行一行的读取文件。 转载于:https://blog.51cto.com/wushipeng/1772207