1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
#!/usr/bin/env python
# -*- coding:Utf-8 -*-
import ConfigParser
from Tkinter import *
#paquet python-pil
from PIL import Image,ImageTk
fen1 =Tk()
L=800
H=600
H_image=L/2
L_image=H/2
my_file = "/home/taz/Desktop/python/img1.png"
can = Canvas(fen1, width =L, height =H, bg ='white')
mon_image=ImageTk.PhotoImage(file=my_file)
can.create_image(H_image,L_image,image=mon_image)
mon_image2=ImageTk.PhotoImage(file="/home/taz/Desktop/python/7.png")
bou1 = Button(fen1, text='Quitter',image=mon_image2, command = fen1.destroy)
bou1.grid(row=10, column=15)
can.grid(row = 0, rowspan = 20,column =2, columnspan=20, sticky=N)
fen1.mainloop() |
Partager