在自学python文件这一章节对代码进行练习
with open('C:/Users/张念安/Desktop/test.txt',encoding='UTF-8') as f:read = f.read()print(f)
<_io.TextIOWrapper name='C:/Users/张念安/Desktop/test.txt' mode='r' encoding='UTF-8'>
输出文本文件中的内容
print(read)