from googletrans import Translator, constants
from pprint import pprint
from PIL import Image
import googletrans
import pytesseract
import pyautogui
import time
import os
file_number = 1
file_name = file_name = "memrise_screenshot" + str(file_number) + ".png"
pyautogui.screenshot(file_name)
file_number = (file_number) + 1
image = Image.open(file_name)
gray_image = image.convert("L")
text = pytesseract.image_to_string(gray_image)
clean_text = text.replace("\\x0c", "").strip()
\##### image deleter
os.remove(file_name)
translator = Translator()
translation = translator.translate(clean_text)
print(f"{translation.origin} ({translation.src}) --\> {translation.text} ({translation.dest})")
print(file_name)
-`
.o+`
`ooo/
`+oooo:
`+oooooo:
-+oooooo+:
`/:-:++oooo+:
`/++++/+++++++: blou
`/++++++++++++++: ---------
`/+++ooooooooooooo/` OS //>wwwwwwwwwww
Подробнее здесь: https://stackoverflow.com/questions/798 ... -no-reason