Tkinter控件加载图片

img = PhotoImage(file=’./img/1.gif’)
print img

Button(root, command = p, image = img).pack()
Label(root, image = img).pack()

你可能感兴趣的:(python)