【Python】读取TXT文档的中文

一、代码部分

with open('word.txt',mode='r',encoding='utf-8')  as file:
    str=file.readlines()

二、稍作解释

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_43586192/article/details/109467387