标签: python-3.x python-imaging-library python-tesseract python-imageio
我有一个要转换为图像格式的PDF图像,因此我试图读取PDF图像并将数据存储在文本文件中。
import pytesseract from PIL import Image img = Image.open('1.pdf') text = pytesseract.image_to_string(img) with open('1.txt', mode='w') as file: file.write(text)
运行此命令时出现错误can't set attribute
can't set attribute