python 读取文本文件

python 读取文本文件

 

 

# 打开文件
with open('myfile.txt', 'r') as file:
    # 读取文件内容
    content = file.read()
    
    # 打印文件内容
    print(content)

 

 

##########################

posted @ 2024-08-10 19:38  西北逍遥  阅读(16)  评论(0)    收藏  举报