从文本文件python导入时unicode不打印

问题描述

我正在从 python 读取文本文件,当它打印 Unicode 时,它​​不打印符号。

input.txt:

path

代码:

hello world
\u00a9

输出:

from pathlib import Path 
with open('input.txt','r') as file:
    txt = Path('input.txt').read_text()
    print(txt)

预期输出:

hello world 
\u00a9

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)