Projet KNN
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.

79 lines
2.1 KiB

from tkinter import *
fenetre = Tk()
txt_design = font = ('Helvetica', 12, 'bold', 'underline','italic')
canvas1 = Canvas(fenetre)
global colour
global colourselection
global count
colour = ""
colourselection= ['red', 'blue', 'white']
count = 0
def start(parent):
Tk.after(parent, 1000, change)
def change():
global colour
global colourselection
global count
if (count == 1):
fenetre.configure(bg = 'blue')
if (count == 2):
fenetre.configure(bg = 'white')
if (count == 3):
fenetre.configure(bg = 'red')
start(fenetre)
for i in range (1):
count = count + 1
if count == 4:
count = 1
change()
label1 = Label(fenetre, text="Choisissez le nombre de voisins (k) :",font =
txt_design,bg ='#005dff',foreground="#ff5733")
value1 = IntVar()
entree1 = Entry(fenetre, textvariable=value1)
label2 = Label(fenetre, text="Veuillez entrez la date (format 'aaaa-mm-jj'):",font =
txt_design,bg ='#005dff',foreground="#ff5733")
value2 = IntVar()
entree2 = Entry(fenetre, textvariable=value2)
label3 = Label(fenetre, text="Veuillez entrez la température moyenne (en °C):",font =
txt_design,bg ='#005dff',foreground="#ff5733")
value3 = IntVar()
entree3 = Entry(fenetre, textvariable=value3)
label4 = Label(fenetre, text="Veuillez entrez la température de référence (en °C) :",font =
txt_design,bg ='#005dff',foreground="#FF5733")
value4 = IntVar()
entree4 = Entry(fenetre, textvariable=value4)
label1.grid(pady=10)
entree1.grid()
label2.grid(pady=10)
entree2.grid()
label3.grid(pady=10)
entree3.grid()
label4.grid(pady=10)
entree4.grid()
label9= Label(fenetre,width=8, text="Conso", bg="#b054da",fg='#fbff7a',font =('calibri',9,'bold') ,relief ='groove')
bouton1 = Button(canvas1, text="Tester", command=fenetre.destroy,height=2,width=8 ,bg="#e7374c",fg='#fbff7a', font =
('colibri',13,'bold')).grid()
canvas1.grid(pady = 15)
label9.grid()
fenetre.title("IHM KNN")
fenetre.iconbitmap('icon.ico')
fenetre['bg'] = '#fd9f9f'
fenetre.geometry('400x360')
fenetre.mainloop()