marvyn.meunier
2 years ago
commit
e67ab31c58
1 changed files with 42 additions and 0 deletions
@ -0,0 +1,42 @@ |
|||||
|
from tkinter import * |
||||
|
|
||||
|
|
||||
|
def IMC(): |
||||
|
valeur = value.get() |
||||
|
valeur2 = value2.get() |
||||
|
imc = valeur / (valeur2*0.01)**2 |
||||
|
label.configure(text="Cela donne "+str(imc)+" IMC") |
||||
|
|
||||
|
fenetre = Tk() |
||||
|
fenetre.title('Calcul de IMC') |
||||
|
fenetre.configure(bg='#988080') |
||||
|
|
||||
|
expliquation = Label(fenetre, text="Cette fenêtre permets de donner votre IMC ", bg='#988080') |
||||
|
expliquation.grid(row =1, column=0, columnspan=3) |
||||
|
|
||||
|
fonction = Label(fenetre, text="donner votre poids (kg) :", bg='#988080') |
||||
|
fonction.grid(row=2, column=0, columnspan=1) |
||||
|
|
||||
|
fonction = Label(fenetre, text="donner votre taille (cm) :", bg='#988080') |
||||
|
fonction.grid(row=2, column=2, columnspan=3) |
||||
|
|
||||
|
value = IntVar() |
||||
|
value.set(0) |
||||
|
|
||||
|
entree = Entry(fenetre, textvariable=value, width=30) |
||||
|
entree.grid(row=3, column=0) |
||||
|
|
||||
|
value2 = IntVar() |
||||
|
value2.set(0) |
||||
|
|
||||
|
entree2 = Entry(fenetre, textvariable=value2, width=30) |
||||
|
entree2 .grid(row=3, column=2) |
||||
|
|
||||
|
Button(text="donner IMC", bg='#89BCB6', command=IMC).grid(row=5, column=1 ,columnspan=1) |
||||
|
|
||||
|
|
||||
|
label = Label(fenetre, text="'resultat de IMC'") |
||||
|
label.grid(row=4, column = 1,columnspan=1) |
||||
|
|
||||
|
|
||||
|
fenetre.mainloop() |
Loading…
Reference in new issue