📅  最后修改于: 2022-03-11 14:56:26.811000             🧑  作者: Mango
try:
from PIL import Image
except ImportError:
import Image
import pytesseract
# Simple image to string
text=print(pytesseract.image_to_string(Image.open('test.jpg'),lang="eng"))
with open('out.txt', 'w') as f:
print(text, file=f)