How to insert an image into a button?
问题 I'm executing the following code import tkinter import tkinter.messagebox import random from PIL import Image item = tkinter.Button(root, text=color, width=20, height=10, relief='raised', borderwidth=5, bg=color ) original = Image.open('images/img1.gif') ph_im = Image.PhotoImage(original) item.config(image=ph_im) item.pack(side='left') I am using Pillow for Python33. I'm trying to insert an image into a button, but returns this error message: Traceback (most recent call last): File "C: