from PIL import Image def logo(): #打开图片-二进制打开 fp =open('2.jpg','rb') #转换为Image对象 imagefile=Image.open(fp) #调整图片大小