from PIL import Image from pytesseract import image_to_string code = image_to_string(Image.open("code.png")) print(code)