| 12
 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
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 
 |  
from tkinter import * 
 
fenetre = Tk()
fenetre.geometry("1024x768+300+0")
 
menu1 = 0
 
txt1 = Label(fenetre, text="Bienvenu chez Macdo")
txt1.pack()
txt2 = Label(fenetre, text="Veuillez choisir votre Menu est comparer les prix :")
txt2.place(x=45, y=40)
 
var1 = 13
 
def ttcgrenoble():
    Resultat.set("Montant total ttc pour Grenoble = "++str(float(menucfg1.get())+menucfg2.get))
 
 
def calculgrenoble():
    Resultat.set(menucfg1.get())
menucfg1 = StringVar()
menucfg1.set(0)
menu1 = Label(fenetre,text="Big Mac").place(x=75, y=70)
menuconfig1 = Spinbox(fenetre,from_=0,to=10,increment=1,textvariable=menucfg1,width=2,command=calculgrenoble).place(x=45, y=70)
 
 
def calculgrenoble2():
    Resultat.set(menucfg2.get())
menucfg2 = StringVar()
menucfg2.set(0)
menu2 = Label(fenetre, text="Royal Bacon").place(x=75, y=100)
menuconfig2 = Spinbox(fenetre,from_=0,to=10,increment=1,textvariable=menucfg2,width=2,command=calculgrenoble).place(x=45, y=100)
 
 
coche3 = Checkbutton(fenetre, text="Royal Cheese")
coche3.place(x=45, y=130)
coche4 = Checkbutton(fenetre, text="McWrap Chèvre")
coche4.place(x=45, y=160)
coche5 = Checkbutton(fenetre, text="McChiken")
coche5.place(x=45, y=190)
 
coche6 = Checkbutton(fenetre, text="Royal Deluxe ")
coche6.place(x=180, y=70)
coche7 = Checkbutton(fenetre, text="Chicken McNuggets fois 6")
coche7.place(x=180, y=100)
coche8 = Checkbutton(fenetre, text="Filet-O-Fish")
coche8.place(x=180, y=130)
coche9 = Checkbutton(fenetre, text="Double Cheese")
coche9.place(x=180, y=160)
coche10 = Checkbutton(fenetre, text="Cheeseburger")
coche10.place(x=180, y=190)
 
 
 
Resultat = StringVar()
ttcgrenoble()
Label(fenetre,textvariable=Resultat).pack(padx=30,pady=10)
 
 
 
 
 
fenetre.mainloop() | 
Partager