这是因为在文件路径中使用反斜杠(\)时,它被视为转义字符,因此需要使用两个反斜杠来表示一个反斜杠。在输出中,Python自动将两个反斜杠转换为一个反斜杠。因此,D:\1483667886\utx\demo\report\chat_report.html 在输出中变成了D:\1483667886\utx\demo\report\chat_report.html。

D1483667886utxdemoreportchat_reporthtml 查看报告写入文件后为什么变成D1483667886utxdemoreportchat_reporthtml 查看报告了

原文地址: https://www.cveoy.top/t/topic/bO4n 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录