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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
from tkinter import *
import tkinter as tk
from PIL import Image, ImageTk, ImageDraw
import webbrowser
def stop():
root.destroy()
def open_link():
webbrowser.open("https://xxx")
def open_link2():
webbrowser.open("https://xxx")
def open_link3():
webbrowser.open("https://fxx")
root = Tk()
root.title("Mon application Python V.0.1")
# Charger l'image
image = Image.open("Nouveau dossier/R.jpg")
photo = ImageTk.PhotoImage(image)
# Créer un widget Label pour afficher l'image
label_image = tk.Label(root, image=photo)
label_image.pack()
#un bouton qui arrête l'app
quit_button = tk.Button(root, text="Quitter", command=stop, bg="#0F488D", fg="white", font=("Arial", 25))
quit_button.pack()
# Créer les boutons
button1 = Button(root, text="Configuration d'un SM400",bg="#1D194D", fg="white", font=("Arial", 25), command=open_link)
button2 = Button(root, text="Cablage ORANGE +", bg="#1D194D", fg="white", font=("Arial", 25), command=open_link2)
button3 = Button(root, text="Configuration d'un Wave I/O", bg="#1D194D", fg="white", font=("Arial", 25) )
button4 = Button(root, text="Configuration d'un SM400",bg="#0F488D", fg="white", font=("Arial", 25), command=open_link)
button5 = Button(root, text="Cablage ORANGE +", bg="#0F488D", fg="white", font=("Arial", 25), command=open_link3)
button6 = Button(root, text="Configuration d'un Wave I/O", bg="#0F488D", fg="white", font=("Arial", 25))
button1.place(x=10, y=70)
button2.place(x=417, y=70)
button3.place(x=750, y=70)
button4.place(x=10, y=0)
button5.place(x=417, y=0)
button6.place(x=750, y=0)
root.mainloop() |