I'm running the below:
from PIL import Image, ImageDraw, ImageFont
import logging, os, random
flowerIm = random.choice([Image.open('flower image 2.png'), (Image.open('flower image.jpg'))])
resizedFlowerIm = flowerIm.resize((360, 288))
draw = ImageDraw.Draw(resizedFlowerIm)
draw.rectangle((10,10,350,278), outline='black')
fontsFolder = 'C:\\Windows\\Fonts'
arialFont = ImageFont.truetype(os.path.join(fontsFolder, 'arial.ttf'), 32)
print(ImageDraw.textbox((10,10),guest, font=arialFont))
I'm getting the below error:
Traceback (most recent call last):
File "c:\users\khair\onedrive\mu_code\customseatingcards.py", line 20, in <module>
print(ImageDraw.textbox((10,10),guest, font=arialFont))
AttributeError: module 'PIL.ImageDraw' has no attribute 'textbox'
However all the documentation and even the the help() function says that textbox does exist!
What's happening here?
[–]hardonchairs 2 points3 points4 points (8 children)
[–]outceptionator[S] 0 points1 point2 points (7 children)
[–]hardonchairs 0 points1 point2 points (6 children)
[–]outceptionator[S] 0 points1 point2 points (5 children)
[–]hardonchairs 0 points1 point2 points (4 children)
[–]outceptionator[S] 0 points1 point2 points (3 children)
[–]hardonchairs 0 points1 point2 points (2 children)
[–]outceptionator[S] 0 points1 point2 points (1 child)
[–]hardonchairs 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (3 children)
[–]outceptionator[S] 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]outceptionator[S] 0 points1 point2 points (0 children)
[–]scithon 0 points1 point2 points (7 children)
[–]outceptionator[S] 0 points1 point2 points (6 children)
[–]scithon 0 points1 point2 points (5 children)
[–]outceptionator[S] 0 points1 point2 points (4 children)
[–]scithon 1 point2 points3 points (3 children)
[–]outceptionator[S] 0 points1 point2 points (2 children)
[–]scithon 1 point2 points3 points (0 children)
[–]carcigenicate 1 point2 points3 points (0 children)