1

我在以下函数中意外缩进。

def save_hocr(self,data = []):
   df_hocr =data
   u= 0
   for img in df_hocr:
       u = u+1 
       image = base64b64decode(str(img))
       img = Image.open(io.BytesIO(image))
       imagePath = (D:\\'+str(u)+".jpeg")
       img.save(imagePath,'jpeg')
       hocr = pytesseract.image_to_pdf_or_hocr(img,extension= 'hocr')
       Y = open(str(u)+".html","wb")
       Y.write(hocr)
       Y.close()
  return "ok"
4

0 回答 0