from PIL import Image
import tkinter as Tk
root = Tk.Tk()
 
a=Image.open('canon.gif')


 
def change():
    canvas.itemconfig(item,image=Tk.PhotoImage(a.rotate(int(e.get()))))
 
e=Tk.Entry(root)
f=Tk.Button(root, text="changer l'angle", command=change)
canvas = Tk.Canvas(root)
photo = Tk.PhotoImage(file='canon.gif')
item = canvas.create_image(10, 10, anchor=Tk.NW, image=photo)
 
e.pack()
f.pack()
canvas.pack()    
root.mainloop()