代码以及效果如下 import numpy as np import random import PIL.Image as image import PIL.ImageDraw as draw import PIL.ImageFont as imgfont import PIL.ImageFilter as ifr font = imgfont.truetype("C:/Windows/Fonts/CHARLEMAGNESTD-BOLD.OTF",60)#导入字体路径以及大小 w=240 h=90 def randomzi():#定义随机字的函数 return chr(random.r