python读取文件

孙琳的博客 / 2024-02-19 / 原文

1:在python相关路径内创建个文件

2:read读取即可

with open("sunlin.txt")as f:
content=f.read()
print(content)