【发布时间】:2019-01-08 14:42:20
【问题描述】:
我正在使用 Google vision api 从图像中提取文本,并且我还想将此文本存储在 .txt 文件中。
每当我使用f.write(text.description) 时,我都会得到:
UnicodeEncodeError
f.write(text) 它给了我:
TypeError: write() 参数必须是 str,而不是 EntityAnnotation
f.write(text.description.encode("utf-8")) 给我:
TypeError: write() 参数必须是 str,而不是字节。
【问题讨论】:
标签: python