并非所有在字符串格式化期间转换的参数都".error"



此代码显示在字符串格式化错误期间转换的所有参数都不能解决这个问题

with open('../jangi/Downloads/easyocr-demo-master/save.txt', 'w') as f:
for item in results:
f.write("%sn" % item)

你应该使用

f.write(f"{item}n")

f.write("%sn" % str(item))

无论item是什么类型,它都会将其写入字符串

最新更新