from PIL import Image, ImageDraw, ImageFont
import os
img = Image.new('RGB', (100, 30), color = (73, 109, 137))
#fnt = ImageFont.truetype('/Library/Fonts/Arial.ttf', 15)
d = ImageDraw.Draw(img)
d.text((10,10), "Hello world", fill=(255, 255, 0))
#img.save('pil_text_font.png')
I want to print this image on paper. How can I do that? I tried,
os.startfile(img,'print')
Error:
TypeError: startfile: filepath should be string, bytes or os.PathLike, not Image