這是一個適合我的例子。
#----------------------------------------------------------------------
import Tkinter
#----------------------------------------------------------------------
root = Tkinter.Tk()
frame = Tkinter.Frame(root)
frame = Tkinter.LabelFrame(root, text="LabelFrame text", padx=5, pady=5)
frame.pack(side=Tkinter.LEFT)
Label1 = Tkinter.Label(frame, text="Label1 text")
Label1.pack()
#----------------------------------------------------------------------
photo1 = Tkinter.PhotoImage(file = 'Chart_Example.gif')
#
width_1 = photo1.width()
height_1 = photo1.height()
#
x_center_1 = width_1/2.0
y_center_1 = height_1/2.0
#---------------------------------
iframe1 = Tkinter.Frame(frame, bd=2, relief=Tkinter.RAISED)
iframe1.pack(expand=1, fill=Tkinter.X, pady=5, padx=5, side=Tkinter.LEFT)
c1 = Tkinter.Canvas(iframe1, width=width_1, height=height_1)
c1.create_image(x_center_1, y_center_1, image=photo1, anchor = Tkinter.CENTER)
c1.pack(side=Tkinter.LEFT)
#----------------------------------------------------------------------
root.mainloop()
#----------------------------------------------------------------------
這是一個非常貧血的問題,提供更多的細節,如什麼錯誤? (完整的堆棧跟蹤會很好) – Nullman
如果沒有[mcve](http://stackoverflow.com/help/mcve),我無法確定,但這可能有助於http://stackoverflow.com/questions/16424091/putting -gif-in-a-canvas-with-tkinter –
「一個錯誤」是無用的信息。請發佈確切的錯誤。 –