# Créé par apatura, le 30/04/2014 en Python 3.2 from tkinter import * from PIL import Image, ImageTk nombreclic=0 ima=['../photos_papillons/alexanor.jpg','../photos_papillons/IMG_1334.JPG','../photos_papillons/agriades-glandon-ter.JPG'] def creerimage(): global nombreclic,photo,i if nombreclic>=3: nombreclic=0 c.delete(i) image = Image.open(ima[nombreclic]) image.thumbnail((160, 120), Image.ANTIALIAS) photo = ImageTk.PhotoImage(image) i=c.create_image(200, 200, image=photo) nombreclic=nombreclic+1 f=Tk() c=Canvas(f,height=500,width=500,bg='ivory') image = Image.open(ima[0]) image.thumbnail((160, 120), Image.ANTIALIAS) photo = ImageTk.PhotoImage(image) i=c.create_image(200, 200, image=photo) c.delete(i) c.pack(side=TOP) e=Button(f,text="Cliquer ",command=creerimage) e.pack() b=Button(f,text="Quitter",command=f.quit)# on pourrait mettre simplement destroy() ce qui éviterait de le mettre après mainloop() b.pack() f.mainloop() f.destroy()