From efb77322e6c78427b6091a5a403f25ea1112611e Mon Sep 17 00:00:00 2001 From: VANDEPOELE Enzo Date: Thu, 12 May 2022 09:06:17 +0200 Subject: [PATCH] =?UTF-8?q?D=C3=A9pot=20:=20IHM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A enregistrez avec le "icon.ico" pour éviter un crash. --- IHM.py | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 IHM.py diff --git a/IHM.py b/IHM.py new file mode 100644 index 0000000..a992a4c --- /dev/null +++ b/IHM.py @@ -0,0 +1,65 @@ +from tkinter import * + + +def recup1(): + voisins = value1.get() + label5.configure(text=voisins) + +def recup2(): + date = value2.get() + label6.configure(text=date) + +def recup3(): + temp_moy = value3.get() + label6.configure(text=temp_moy) + +def recup4(): + temp_ref = value4.get() + label6.configure(text=temp_ref) + +def calc_conso(): + Conso = ("Calcul pour valeur à afficher") + label8.configure(text=Conso) + +fenetre = Tk() + +canvas1 = Canvas(fenetre) + +label1 = Label(fenetre, text="Choisissez le nombre de voisins (k) :") +value1 = IntVar() +entree1 = Entry(fenetre, textvariable=value1, width=45) + +label2 = Label(fenetre, text="Veuillez entrez la date (format 'aaaa-mm-jj'):", width=45) +value2 = IntVar() +entree2 = Entry(fenetre, textvariable=value2, width=45) + +label3 = Label(fenetre, text="Veuillez entrez la température moyenne (en °C):", width=45) +value3 = IntVar() +entree3 = Entry(fenetre, textvariable=value3, width=45) + +label4 = Label(fenetre, text="Veuillez entrez la température de référence (en °C) :", width=45) +value4 = IntVar() +entree4 = Entry(fenetre, textvariable=value4, width=45) + +label1.grid(pady=10) +entree1.grid() + +label2.grid(pady=10) +entree2.grid() + +label3.grid(pady=10) +entree3.grid() + +label4.grid(pady=10) +entree4.grid() + +label8 = Label(fenetre, text="Conso", bg="yellow") + +bouton1 = Button(canvas1, text="Tester", command=calc_conso, width=15, height=2, bg="cyan").grid(pady=10) + +canvas1.grid() +label8.grid(pady=10) + +fenetre.title("IHM KNN") +fenetre.iconbitmap('icon.ico') +fenetre.mainloop()