Python如何读取中文
直接读取:
Python 3中默认支持Unicode编码,因此可以直接读取中文文件。
<code class="<a style=\'color:#f60; text-decoration:underline;\' href=" https: target="_blank">python">with open(\'test.txt\', \'r\', encoding=\'utf-8\') as f: text = f.read() print(text)