You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
1.6 KiB
65 lines
1.6 KiB
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()
|
|
|