一、读文件

filename = 'pi_digits.txt'
with open(filename) as file_object:

contents = file_object.read()----->读取

print(contents)

 lines = file_object.readlines()------------------>按行读取
 for line in lines:
print(line.rstrip())