小编Mar*_* W.的帖子

Python - file.write() 导致中文文本

当我在无限循环中将某个字符串写入文件时,例如:

file = open('txt.txt', 'w')
while 1:
    file.write('colour')
Run Code Online (Sandbox Code Playgroud)

它给了我所有这些中文文本: 图片

为什么会发生这种情况?

python-3.5

5
推荐指数
1
解决办法
729
查看次数

标签 统计

python-3.5 ×1