text to image python

from PIL import Image
import pytesseract

image = 'PATH/TO/IMAGE'
text = pytesseract.image_to_string(Image.open(image), lang="eng")

# Code From here: https://www.youtube.com/watch?v=kxHp5ng6Rgw

Here is what the above code is Doing:
1. Importing the pytesseract library
2. Opening the image using the PIL library
3. Using pytesseract to convert the image to string
4. Printing the string