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 27 28 29
| #!/usr/bin/env python
import Tkinter
import urllib
MesFavoris=Tkinter.Tk()
label= Tkinter.Label(MesFavoris, text='Presentation de mes favoris')
label.pack()
Tkinter.mainloop
# Action sur le bouton Google
def click1():
url1="http://www.google.fr"
ouvert=urllib.urlopen(url1)
lapage1=ouvert.read()
# Creation du bouton exit et son action
exit=Tkinter.Button (MesFavoris, text='quit', command=MesFavoris.quit)
exit.pack()
Tkinter.mainloop()
# Creation du bouton Google
Google=Tkinter.Button (MesFavoris, text='Google', command=click1)
Google.pack()
Tkinter.mainloop() |