IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Tkinter Python Discussion :

Comment le simplifier?


Sujet :

Tkinter Python

  1. #1
    Futur Membre du Club
    Profil pro
    Inscrit en
    Décembre 2008
    Messages
    21
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2008
    Messages : 21
    Points : 7
    Points
    7
    Par défaut Comment le simplifier?
    Bonjours, je suis debutante, je veux faire un truc pouvant etre mis a un PDA a restaurant qui sert a faire commandes par les clients et les serveurs, et il realise les fonctions basiques telles que Faire l’addition, Sélectionner des plats, Connaître le nombre de couverts, Repérer les tables réservées, Voir la ommande complète, Vérifier la disponibilité des plats, D’annuler, ou de modifier toute opération..
    Le probleme est que je voudrais creer une classe pour eviter repeter les codes communes dans la fonction "creer_canvas","touche" et "demander", c-a-d, automatiser la disposition des plats et les fonctions concernees, mais je n'y pas arrive. Le code concernee que j'ai ecrit est la suivante:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    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
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
     
    ##-	Faire l’addition
    ##-	Sélectionner des plats
    ##-	Connaître le nombre de couverts
    ##-	Repérer les tables réservées
    ##-	Voir la commande complète
    ##-	Vérifier la disponibilité des plats
    ##-	D’annuler, ou de modifier toute opération
     
     
    from Tkinter import *
     
     
    mot=''
    mots=[]
    no=0
    total=0
    dispo1=7
    dispo2=7
     
    def touche_can1(e):
        global fenbul,mot1,mes1
        eti1=StringVar()
        can1.config(cursor='hand2')
        fenbul=Toplevel()
        fenbul.config(bg='yellow')
        geo1=fen1.winfo_geometry()
        geox=fen1.winfo_rootx()
        geoy=fen1.winfo_rooty() 
        fenbul.geometry("50x19+"+str(geox+99)+"+"+str(geoy+80))
        fenbul.resizable(width=False, height=False)
        fenbul.overrideredirect(1)
        mes1=Message(fenbul,bg='yellow',fg='black',width=500,font=('Arial', 8),text="GLACE",relief=RIDGE, aspect=127, textvariable="2.7")
        mes1['text']=eti1.get()
        mes1.pack()
        mot1= str(mes1['aspect'])+'/'+mes1['text']+'/'+mes1['textvariable']
     
    def touche_can2(e):
        global fenbul,mot2,mes2
        eti2=StringVar()
        can2.config(cursor='hand2')
        fenbul=Toplevel()
        fenbul.config(bg='yellow')
        geo1=fen1.winfo_geometry()
        geox=fen1.winfo_rootx()
        geoy=fen1.winfo_rooty() 
        fenbul.geometry("50x19+"+str(geox+199)+"+"+str(geoy+80))
        fenbul.resizable(width=False, height=False)
        fenbul.overrideredirect(1)
        mes2=Message(fenbul,bg='yellow',fg='black',width=500,font=('Arial', 8),text="CAFE",relief=RIDGE, aspect=124, textvariable="1.2")
        mes2['text']=eti2.get()
        mes2.pack()
        mot2= str(mes2['aspect'])+'/'+mes2['text']+'/'+mes2['textvariable']   
     
    def fleche(e) :
        restau()
     
    def restau() :
        global fenbul
        fen1.config(cursor='arrow')
        fenbul.destroy()
     
     
    def modifier():
        memo.delete(0,END)
        fic = open('liste.txt','a')
        fic.write("******* R E C O M M E N C E R *******")
        fic.write("\n")
     
    def quitter_prog() :
        global fenqui    
        fenqui=Toplevel()
        fenqui.config(bg='yellow',bd=3,relief='groove')
        geo1=fen1.winfo_geometry()
        geox=fen1.winfo_rootx()
        geoy=fen1.winfo_rooty() 
        fenqui.geometry("150x60+"+str(geox+220)+"+"+str(geoy+160))
        fenqui.resizable(width=False, height=False)
        fenqui.overrideredirect(1)
        labqui=Label(fenqui,bg='yellow',fg='red',font=('Arial', 10),text="Quitter Commande?")
        labqui.place(x=17,y=1)
        repon=StringVar()
        bououi=Button(fenqui,text="Oui", bg='pink', fg='black',command=confir_quitter)
        bounon=Button(fenqui,text="Non", bg='pink', fg='black',command=continu_prog)
        bououi.place(x=20,y=25)
        bounon.place(x=90,y=25)
     
     
    def confir_quitter() :
        fenqui.destroy()
        global fenenv
        fenenv=Toplevel()
        geo1=fen1.winfo_geometry()
        geox=fen1.winfo_rootx()
        geoy=fen1.winfo_rooty() 
        fenenv.geometry("230x55+"+str(geox+13)+"+"+str(geoy+130))
        labenv=Label(fenenv,bg='yellow',fg='blue',width=30,font=('Arial', 10),text="Les commendes sont envoyees.")
        labenv.place(x=1,y=1)
        bouenv=Button(fenenv,text="OK", fg='blue',command=reussir).pack(side=BOTTOM,pady=3)
     
     
    def continu_prog() :
        global fenqui
        fenqui.destroy()
     
    def ordre():
        global ent,fenord
        fenord=Toplevel()
        geo1=fen1.winfo_geometry()
        geox=fen1.winfo_rootx()
        geoy=fen1.winfo_rooty() 
        fenord.geometry("217x30+"+str(geox-2)+"+"+str(geoy-85))
        Label(fenord, text="NUMERO: ").grid(row=0, sticky=W)
        ent = Entry(fenord)
        ent.grid(row=0, column=1)
        Button(fenord, text="OK", command = numeroter).grid(row = 0, column = 2)
     
    def numeroter():
        global no
        no=0
        no=int(ent.get())
        fenord.destroy()
        numero.configure(text=str(no).capitalize())
        print no
     
    def reussir() :
        fenenv.destroy()
     
     
     
     
     
    def demander_can1(e) :
     
        global feninf,prix,total,dispo1
        eti=StringVar()
        dispo1=dispo1-1
        if dispo1>=0:        
            prix=float(mes1['textvariable'])
            total=total+prix
            mots.append(mot1)
            memo.insert(0,mot1)
            fic = open('liste.txt','a')
            fic.write("numclient:")
            fic.write(str(no))
            fic.write("\n")
            fic.write(mot1)
            fic.write("/"+str(total))
            fic.write("\n")
            fic.close()
     
            print mot1,total,dispo1
        else:
            fenpas=Toplevel()
            w = Label(fenpas, text="Il n'est plus disponible")
            w.pack()
     
     
     
    def demander_can2(e) :
     
        global feninf,prix,total,dispo2
     
        eti=StringVar()
        dispo2=dispo2-1
        if dispo2>=0:
            prix=float(mes2['textvariable'])
            total=total+prix
            mots.append(mot2)
            memo.insert(0,mot2)
            fic = open('liste.txt','a')
            fic.write("numclient:")
            fic.write(str(no))
            fic.write("\n")
            fic.write(mot2)
            fic.write("/"+str(total))
            fic.write("\n")
            fic.close() 
            print mot2,total,dispo2
        else:
            fenpas=Toplevel()
            w = Label(fenpas, text="Il n'est plus disponible")
            w.pack()
     
     
     
    fen1 = Tk(className='Resto')
    fen1.resizable(width=False, height=False)
    fen1.geometry("400x600")
    fen1.iconbitmap("resto.ico")
     
    fram1=Frame(fen1,bg='grey',bd=2,relief='ridge',width=400, height=300)
    fram1.pack(fill=BOTH,expand=1)
     
    fram2=Frame(fen1,bg='grey',bd=2,relief='ridge',width=400, height=300)
    fram2.pack(fill=BOTH,expand=1)
    memo=Listbox(fram2)
    memo.pack(side=LEFT,fill=BOTH)
     
     
    boutonnu=Button(fram2, text='NUMERO', bg='lightblue', command= ordre, fg='blue')
    boutonnu.place(x=320,y=2)
    numero=Label(fram2,text='   ',bg='#80c0c0',font=('times',11,'bold'))
    numero.place(x=377,y=2)
    boutonva=Button(fram2, text="VALIDER", command=quitter_prog, bg='lightblue', fg='blue').pack(side=BOTTOM,padx=1)
    boutonsu=Button(fram2, text="MODIFIER", command=modifier, bg='lightblue', fg='blue').pack(side=BOTTOM,padx=1)
    fic = open('liste.txt','w')
    fic = open('liste.txt','a')
    fic.write("numero d'article/article/prix/total")
    fic.write("\n")
    fic.close()
     
     
    can1 = Canvas(fram1, width=40, height=40)
    signat1=PhotoImage(file='glace.gif')
    sign1=can1.create_image(20,30, image=signat1,tag="glace")
    can1.tag_bind("glace","<ButtonRelease>",demander_can1)
    can1.tag_bind("glace","<Enter>",touche_can1)
    can1.tag_bind("glace","<Leave>",fleche)
    can1.place(x=100,y=100)
     
    can2 = Canvas(fram1, width=40, height=40)
    signat2=PhotoImage(file='cafe.gif')
    sign2=can2.create_image(20,20, image=signat2,tag="cafe")
    can2.tag_bind("cafe","<ButtonRelease>",demander_can2)
    can2.tag_bind("cafe","<Enter>",touche_can2)
    can2.tag_bind("cafe","<Leave>",fleche)
    can2.place(x=200,y=100)
     
    fen1.mainloop()
    Merci d'avance.

  2. #2
    Futur Membre du Club
    Profil pro
    Inscrit en
    Décembre 2008
    Messages
    21
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2008
    Messages : 21
    Points : 7
    Points
    7
    Par défaut J'ai ajoute une classe Plat, mais ca ne fonctionne pas.
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    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
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
     
    ##-	Faire l’addition
    ##-	Sélectionner des plats
    ##-	Connaître le nombre de couverts
    ##-	Repérer les tables réservées
    ##-	Voir la commande complète
    ##-	Vérifier la disponibilité des plats
    ##-	D’annuler, ou de modifier toute opération
     
     
    from Tkinter import *
     
     
    mot=''
    mots=[]
    no=0
    total=0
     
     
     
    class Plat:
        def __init__(self, nom, img, prix):
            self.nom = nom
            self.img = img
            self.prix = prix
     
            mot=''
            mots=[]
            no=0
            article=''
        def creer_canvas(self,parent):
            can = Canvas(parent, width=40, height=40)
            self.imgobj = PhotoImage(file=self.img) 
            can.create_image(20,30, image=self.imgobj, tag=self.nom)      
            can.tag_bind(self.nom, "<Button-1>", self.commander)
            can.tag_bind(self.nom,"<Enter>",self.touche)
            can.tag_bind(self.nom,"<Leave>",self.fleche)
     
     
        def touche(self,e):
            global fenbul,mot,mes
            eti1=StringVar()
            can1.config(cursor='hand2')
            fenbul=Toplevel()
            fenbul.config(bg='yellow')
            geo1=fen1.winfo_geometry()
            geox=fen1.winfo_rootx()
            geoy=fen1.winfo_rooty() 
            fenbul.geometry("50x19+"+str(geox+99)+"+"+str(geoy+80))
            fenbul.resizable(width=False, height=False)
            fenbul.overrideredirect(1)
            mes=Message(fenbul,bg='yellow',fg='black',width=500,font=('Arial', 8),text=self.nom,relief=RIDGE, aspect=127, textvariable=self.prix)
            mes['text']=eti1.get()
            mes.pack()
            mot= str(mes['aspect'])+'/'+mes['text']+'/'+mes['textvariable']
     
     
        def commander(self,e):
            global feninf,prix,total    
            eti=StringVar()
            prix=float(mes['textvariable'])
            total=total+prix
            mots.append(mot)
            memo.insert(0,mot)
            fic = open('liste.txt','a')
            fic.write("numclient:")
            fic.write(str(no))
            fic.write("\n")
            fic.write(mot)
            fic.write("/"+str(total))
            fic.write("\n")
            fic.close()
            print mot,total
     
     
        def fleche(self,e) :
            restau()
     
        def restau() :
            global fenbul
            fen1.config(cursor='arrow')
            fenbul.destroy()
     
    fen1 = Tk(className='Resto')
    fen1.resizable(width=False, height=False)
    fen1.geometry("400x600")
    fen1.iconbitmap("resto.ico")
     
    fram1=Frame(fen1,bg='grey',bd=2,relief='ridge',width=400, height=300)
    fram1.pack(fill=BOTH,expand=1)
     
    fram2=Frame(fen1,bg='grey',bd=2,relief='ridge',width=400, height=300)
    fram2.pack(fill=BOTH,expand=1)
    memo=Listbox(fram2)
    memo.pack(side=LEFT,fill=BOTH)
     
     
    boutonnu=Button(fram2, text='NUMERO', bg='lightblue', command=ordre, fg='blue')
    boutonnu.place(x=320,y=2)
    numero=Label(fram2,text='   ',bg='#80c0c0',font=('times',11,'bold'))
    numero.place(x=377,y=2)
    ##addition=Label(fram2,text='   ',bg='#80c0c0',font=('times',11,'bold')).pack(side=BOTTOM,padx=1)
    ##entreenu=Entry(fram2,width=2)
    ##entreenu.place(x=377,y=2)
    boutonva=Button(fram2, text="VALIDER", command=quitter_prog, bg='lightblue', fg='blue').pack(side=BOTTOM,padx=1)
    boutonsu=Button(fram2, text="MODIFIER", command=modifier, bg='lightblue', fg='blue').pack(side=BOTTOM,padx=1)
    fic = open('liste.txt','w')
    fic = open('liste.txt','a')
    fic.write("numero d'article/article/prix/total")
    fic.write("\n")
    fic.close()
     
     
    glace=Plat("glace","glace.gif",2.7)
    can1.creer_canvas(fram1)
    can1.place(x=200,y=100)
     
    cafe=Plat("cafe","cafe.gif",1.2)
    can2.creer_canvas(fram1)
    can2.place(x=100,y=100)
     
    def modifier():
        memo.delete(0,END)
        fic = open('liste.txt','a')
        fic.write("******* R E C O M M E N C E R *******")
        fic.write("\n")
     
    def quitter_prog() :
        global fenqui    
        fenqui=Toplevel()
        fenqui.config(bg='yellow',bd=3,relief='groove')
        geo1=fen1.winfo_geometry()
        geox=fen1.winfo_rootx()
        geoy=fen1.winfo_rooty() 
        fenqui.geometry("150x60+"+str(geox+220)+"+"+str(geoy+160))
        fenqui.resizable(width=False, height=False)
        fenqui.overrideredirect(1)
        labqui=Label(fenqui,bg='yellow',fg='red',font=('Arial', 10),text="Quitter Commande?")
        labqui.place(x=17,y=1)
        repon=StringVar()
        bououi=Button(fenqui,text="Oui", bg='pink', fg='black',command=confir_quitter)
        bounon=Button(fenqui,text="Non", bg='pink', fg='black',command=continu_prog)
        bououi.place(x=20,y=25)
        bounon.place(x=90,y=25)
     
     
    def confir_quitter() :
        fenqui.destroy()
        global fenenv
        fenenv=Toplevel()
        geo1=fen1.winfo_geometry()
        geox=fen1.winfo_rootx()
        geoy=fen1.winfo_rooty() 
        fenenv.geometry("230x55+"+str(geox+13)+"+"+str(geoy+130))
        labenv=Label(fenenv,bg='yellow',fg='blue',width=30,font=('Arial', 10),text="Les commendes sont envoyees.")
        labenv.place(x=1,y=1)
        bouenv=Button(fenenv,text="OK", fg='blue',command=reussir).pack(side=BOTTOM,pady=3)
     
     
    def continu_prog() :
        global fenqui
        fenqui.destroy()
     
    def ordre():
        global ent,fenord
        fenord=Toplevel()
        geo1=fen1.winfo_geometry()
        geox=fen1.winfo_rootx()
        geoy=fen1.winfo_rooty() 
        fenord.geometry("217x30+"+str(geox-2)+"+"+str(geoy-85))
        Label(fenord, text="NUMERO: ").grid(row=0, sticky=W)
        ent = Entry(fenord)
        ent.grid(row=0, column=1)
        Button(fenord, text="OK", command = numeroter).grid(row = 0, column = 2)
     
    def numeroter():
        global no
        no=0
        no=int(ent.get())
        fenord.destroy()
        numero.configure(text=str(no).capitalize())
        print no
     
    def reussir() :
        fenenv.destroy()
     
    fen1.mainloop()

  3. #3
    Futur Membre du Club
    Profil pro
    Inscrit en
    Décembre 2008
    Messages
    21
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2008
    Messages : 21
    Points : 7
    Points
    7
    Par défaut
    d'une facon plus lourde, j'ai fait une disposition des plats un par un, ca fonctionne, mais repete trop.
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    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
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    ##-	Faire l’addition
    ##-	Sélectionner des plats
    ##-	Connaître le nombre de couverts
    ##-	Repérer les tables réservées
    ##-	Voir la commande complète
    ##-	Vérifier la disponibilité des plats
    ##-	D’annuler, ou de modifier toute opération
     
     
    from Tkinter import *
     
     
    mots=[]
    no=0
    total=0
     
     
    def touche_can1(e):
        global fenbul,mot1,mes1
        can1.config(cursor='hand2')
        fenbul=Toplevel()
        fenbul.config(bg='yellow')
        geo1=fen1.winfo_geometry()
        geox=fen1.winfo_rootx()
        geoy=fen1.winfo_rooty() 
        fenbul.geometry("50x19+"+str(geox+33)+"+"+str(geoy+97))
        fenbul.resizable(width=False, height=False)
        fenbul.overrideredirect(1)
        lab1=Label(fenbul,bg='yellow', fg='black',width=15,font=('Arial', 8),text="ENTREE",relief=RIDGE)
        lab1.pack()
     
    def touche_can2(e):
        global fenbul,mot2,mes2
        can2.config(cursor='hand2')
        fenbul=Toplevel()
        fenbul.config(bg='yellow')
        geo1=fen1.winfo_geometry()
        geox=fen1.winfo_rootx()
        geoy=fen1.winfo_rooty() 
        fenbul.geometry("50x19+"+str(geox+33)+"+"+str(geoy+177))
        fenbul.resizable(width=False, height=False)
        fenbul.overrideredirect(1)
        lab2=Label(fenbul,bg='yellow', fg='black',width=15,font=('Arial', 8),text="PLAT",relief=RIDGE)
        lab2.pack()
     
    def touche_can3(e):
        global fenbul,mot3,mes3
        can3.config(cursor='hand2')
        fenbul=Toplevel()
        fenbul.config(bg='yellow')
        geo1=fen1.winfo_geometry()
        geox=fen1.winfo_rootx()
        geoy=fen1.winfo_rooty() 
        fenbul.geometry("50x19+"+str(geox+33)+"+"+str(geoy+257))
        fenbul.resizable(width=False, height=False)
        fenbul.overrideredirect(1)
        lab3=Label(fenbul,bg='yellow', fg='black',width=15,font=('Arial', 8),text="BOISSON",relief=RIDGE)
        lab3.pack()
     
    def touche_can4(e):
        global fenbul,mot4,mes4
        can4.config(cursor='hand2')
        fenbul=Toplevel()
        fenbul.config(bg='yellow')
        geo1=fen1.winfo_geometry()
        geox=fen1.winfo_rootx()
        geoy=fen1.winfo_rooty() 
        fenbul.geometry("50x19+"+str(geox+33)+"+"+str(geoy+337))
        fenbul.resizable(width=False, height=False)
        fenbul.overrideredirect(1)
        lab4=Label(fenbul,bg='yellow', fg='black',width=15,font=('Arial', 8),text="DESSERT",relief=RIDGE)
        lab4.pack()
     
    def fleche(e) :
        restau()
     
    def restau() :
        global fenbul
        fen1.config(cursor='arrow')
        fenbul.destroy()
     
     
    def modifier():
        memo.delete(0,END)
        fic = open('liste.txt','w')
        fic.close()
     
    def quitter_prog() :
        global fenqui    
        fenqui=Toplevel()
        fenqui.config(bg='yellow',bd=3,relief='groove')
        geo1=fen1.winfo_geometry()
        geox=fen1.winfo_rootx()
        geoy=fen1.winfo_rooty() 
        fenqui.geometry("150x60+"+str(geox+220)+"+"+str(geoy+160))
        fenqui.resizable(width=False, height=False)
        fenqui.overrideredirect(1)
        labqui=Label(fenqui,bg='yellow',fg='red',font=('Arial', 10),text="Quitter Commande?")
        labqui.place(x=17,y=1)
        repon=StringVar()
        bououi=Button(fenqui,text="Oui", bg='pink', fg='black',command=confir_quitter)
        bounon=Button(fenqui,text="Non", bg='pink', fg='black',command=continu_prog)
        bououi.place(x=20,y=25)
        bounon.place(x=90,y=25)
     
     
    def confir_quitter() :
        fenqui.destroy()
        global fenenv
        fenenv=Toplevel()
        geo1=fen1.winfo_geometry()
        geox=fen1.winfo_rootx()
        geoy=fen1.winfo_rooty() 
        fenenv.geometry("230x55+"+str(geox+13)+"+"+str(geoy+130))
        labenv=Label(fenenv,bg='yellow',fg='blue',width=30,font=('Arial', 10),text="Les commendes sont envoyees.")
        labenv.place(x=1,y=1)
        bouenv=Button(fenenv,text="OK", fg='blue',command=reussir).pack(side=BOTTOM,pady=3)
     
     
    def continu_prog() :
        global fenqui
        fenqui.destroy()
     
    def ordre():
        global ent,fenord
        fenord=Toplevel()
        geo1=fen1.winfo_geometry()
        geox=fen1.winfo_rootx()
        geoy=fen1.winfo_rooty() 
        fenord.geometry("217x30+"+str(geox-2)+"+"+str(geoy-85))
        Label(fenord, text="NUMERO: ").grid(row=0, sticky=W)
        ent = Entry(fenord)
        ent.grid(row=0, column=1)
        Button(fenord, text="OK", command = numeroter).grid(row = 0, column = 2)
     
    def numeroter():
        global no
        no=0
        no=int(ent.get())
        fenord.destroy()
        numero.configure(text=str(no).capitalize())
        print no
     
    def reussir() :
        fenenv.destroy()
     
     
    def commander_e1() :    
        global total
        prix1=3.1
        total=total + prix1
        mot1='ENTR1'+ " / " + str(prix1) 
        mots.append(mot1)
        memo.insert(0,mot1)
        fic = open('liste.txt','a')
        fic.write(str(no) + " / " + mot1 + " / "+str(total) + "\n")
        fic.close()        
        print mot1,total
     
    def commander_e2() :    
        global total
        prix2=3.4
        total=total + prix2
        mot1='ENTR1'+ " / " + str(prix2) 
        mots.append(mot1)
        memo.insert(0,mot1)
        fic = open('liste.txt','a')
        fic.write(str(no) + " / " + mot1 + " / "+str(total) + "\n")
        fic.close()        
        print mot1,total
     
    def commander_e3() :    
        global total
        prix3=3.7
        total=total + prix3
        mot1='ENTR1'+ " / " + str(prix3) 
        mots.append(mot1)
        memo.insert(0,mot1)
        fic = open('liste.txt','a')
        fic.write(str(no) + " / " + mot1 + " / "+str(total) + "\n")
        fic.close()        
        print mot1,total
     
    def commander_p1() :    
        global total
        prix4=7.2
        total=total + prix4
        mot1='PLAT1'+ " / " + str(prix4) 
        mots.append(mot1)
        memo.insert(0,mot1)
        fic = open('liste.txt','a')
        fic.write(str(no) + " / " + mot1 + " / "+str(total) + "\n")
        fic.close()        
        print mot1,total
     
    def commander_p2() :    
        global total
        prix5=7.5
        total=total + prix5
        mot1='PLAT2'+ " / " + str(prix5) 
        mots.append(mot1)
        memo.insert(0,mot1)
        fic = open('liste.txt','a')
        fic.write(str(no) + " / " + mot1 + " / "+str(total) + "\n")
        fic.close()        
        print mot1,total
     
    def commander_p3() :    
        global total
        prix6=7.8
        total=total + prix6
        mot1='PLAT3'+ " / " + str(prix6) 
        mots.append(mot1)
        memo.insert(0,mot1)
        fic = open('liste.txt','a')
        fic.write(str(no) + " / " + mot1 + " / "+str(total) + "\n")
        fic.close()        
        print mot1,total
     
    def commander_b1() :    
        global total
        prix7=3.3
        total=total + prix7
        mot1='BOIS1'+ " / " + str(prix7) 
        mots.append(mot1)
        memo.insert(0,mot1)
        fic = open('liste.txt','a')
        fic.write(str(no) + " / " + mot1 + " / "+str(total) + "\n")
        fic.close()        
        print mot1,total
     
    def commander_b2() :    
        global total
        prix8=6.6
        total=total + prix8
        mot1='BOIS2'+ " / " + str(prix8) 
        mots.append(mot1)
        memo.insert(0,mot1)
        fic = open('liste.txt','a')
        fic.write(str(no) + " / " + mot1 + " / "+str(total) + "\n")
        fic.close()        
        print mot1,total
     
    def commander_b3() :    
        global total
        prix9=9.9
        total=total + prix9
        mot1='BOIS3'+ " / " + str(prix9) 
        mots.append(mot1)
        memo.insert(0,mot1)
        fic = open('liste.txt','a')
        fic.write(str(no) + " / " + mot1 + " / "+str(total) + "\n")
        fic.close()        
        print mot1,total
     
    def commander_d1() :    
        global total
        prix10=1.0
        total=total + prix10
        mot1='DESS1'+ " / " + str(prix10) 
        mots.append(mot1)
        memo.insert(0,mot1)
        fic = open('liste.txt','a')
        fic.write(str(no) + " / " + mot1 + " / "+str(total) + "\n")
        fic.close()        
        print mot1,total
     
    def commander_d2() :    
        global total
        prix11=3.0
        total=total + prix11
        mot1='DESS2'+ " / " + str(prix11) 
        mots.append(mot1)
        memo.insert(0,mot1)
        fic = open('liste.txt','a')
        fic.write(str(no) + " / " + mot1 + " / "+str(total) + "\n")
        fic.close()        
        print mot1,total
     
    def commander_d3() :    
        global total
        prix12=5.0
        total=total + prix12
        mot1='DESS3'+ " / " + str(prix12) 
        mots.append(mot1)
        memo.insert(0,mot1)
        fic = open('liste.txt','a')
        fic.write(str(no) + " / " + mot1 + " / "+str(total) + "\n")
        fic.close()        
        print mot1,total
     
     
     
    fen1 = Tk(className='Resto')
    fen1.resizable(width=False, height=False)
    fen1.geometry("400x600")
    fen1.iconbitmap("resto.ico")
     
    fram1=Frame(fen1,bg='grey',bd=2,relief='ridge',width=400, height=300)
    fram1.pack(fill=BOTH,expand=1)
     
    fram2=Frame(fen1,bg='grey',bd=2,relief='ridge',width=400, height=300)
    fram2.pack(fill=BOTH,expand=1)
    ##memo=Listbox(fram2)
    ##memo.pack(side=LEFT,fill=BOTH)
    scrolly =Scrollbar(fram2,orient=VERTICAL)
    memo = Listbox(fram2,width=31,height=12, yscrollcommand=scrolly.set, font=('Lucida Console', 9))
    scrolly.config(command  = memo.yview)
    scrolly.pack(side=LEFT,fill=Y)
    memo.pack()
     
    boutonnu=Button(fram2, text='NUMERO', bg='lightblue', command= ordre, fg='blue')
    boutonnu.place(x=320,y=2)
    numero=Label(fram2,text='   ',bg='#80c0c0',font=('times',11,'bold'))
    numero.place(x=377,y=2)
     
    boutonva=Button(fram2, text="VALIDER", command=quitter_prog, bg='lightblue', fg='blue')
    boutonva.place(x=235,y=188)
    boutonsu=Button(fram2, text="MODIFIER", command=modifier, bg='lightblue', fg='blue')
    boutonsu.place(x=125,y=188)
    fic = open('liste.txt','w')
    fic = open('liste.txt','a')
    fic.write("numero du client/article/prix/addition")
    fic.write("\n")
    fic.close()
     
     
    can1 = Canvas(fram1, width=50, height=50)
    signat1=PhotoImage(file='entree.gif')
    sign1=can1.create_image(20,30, image=signat1,tag="entree")
    can1.tag_bind("entree","<Enter>",touche_can1)
    can1.tag_bind("entree","<Leave>",fleche)
    can1.place(x=30,y=40)
     
    can2 = Canvas(fram1, width=50, height=50)
    signat2=PhotoImage(file='plat.gif')
    sign2=can2.create_image(30,30, image=signat2,tag="plat")
    can2.tag_bind("plat","<Enter>",touche_can2)
    can2.tag_bind("plat","<Leave>",fleche)
    can2.place(x=30,y=120)
     
    can3 = Canvas(fram1, width=50, height=50)
    signat3=PhotoImage(file='boisson.gif')
    sign3=can3.create_image(20,37, image=signat3,tag="boisson")
    can3.tag_bind("boisson","<Enter>",touche_can3)
    can3.tag_bind("boisson","<Leave>",fleche)
    can3.place(x=30,y=200)
     
    can4 = Canvas(fram1, width=50, height=50)
    signat4=PhotoImage(file='dessert.gif')
    sign4=can4.create_image(20,37, image=signat4,tag="dessert")
    can4.tag_bind("dessert","<Enter>",touche_can4)
    can4.tag_bind("dessert","<Leave>",fleche)
    can4.place(x=30,y=280)
     
    e1=Button(fram1, text='ENTR1', bg='gold', command= commander_e1, fg='blue')
    e1.place(x=130,y=50)
    e2=Button(fram1, text='ENTR2', bg='gold', command= commander_e2, fg='blue')
    e2.place(x=190,y=50)
    e3=Button(fram1, text='ENTR3', bg='gold', command= commander_e3, fg='blue')
    e3.place(x=250,y=50)
     
    p1=Button(fram1, text='PLAT1', bg='gold', command= commander_p1, fg='blue')
    p1.place(x=130,y=130)
    p2=Button(fram1, text='PLAT2', bg='gold', command= commander_p2, fg='blue')
    p2.place(x=190,y=130)
    p3=Button(fram1, text='PLAT3', bg='gold', command= commander_p3, fg='blue')
    p3.place(x=250,y=130)
     
    b1=Button(fram1, text='BOIS1', bg='gold', command= commander_b1, fg='blue')
    b1.place(x=130,y=210)
    b2=Button(fram1, text='BOIS2', bg='gold', command= commander_b2, fg='blue')
    b2.place(x=190,y=210)
    b3=Button(fram1, text='BOIS3', bg='gold', command= commander_b3, fg='blue')
    b3.place(x=250,y=210)
     
    d1=Button(fram1, text='DESS1', bg='gold', command= commander_d1, fg='blue')
    d1.place(x=130,y=290)
    d2=Button(fram1, text='DESS2', bg='gold', command= commander_d2, fg='blue')
    d2.place(x=190,y=290)
    d3=Button(fram1, text='DESS3', bg='gold', command= commander_d3, fg='blue')
    d3.place(x=250,y=290)
     
     
    fen1.mainloop()

  4. #4
    Futur Membre du Club
    Profil pro
    Inscrit en
    Décembre 2008
    Messages
    21
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2008
    Messages : 21
    Points : 7
    Points
    7
    Par défaut
    J'y arrive!! Merci, oiffrig~
    en fait, c'est tout simple,mais je ne savais bien comment la classe fonctionne
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    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
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
     
    ##-	Faire l’addition
    ##-	Sélectionner des plats
    ##-	Connaître le nombre de couverts
    ##-	Repérer les tables réservées
    ##-	Voir la commande complète
    ##-	Vérifier la disponibilité des plats
    ##-	D’annuler, ou de modifier toute opération
     
     
    from Tkinter import *
     
     
    mots=[]
    no=0
    total=0
     
     
    def touche_can1(e):
        global fenbul,mot1,mes1
        can1.config(cursor='hand2')
        fenbul=Toplevel()
        fenbul.config(bg='yellow')
        geo1=fen1.winfo_geometry()
        geox=fen1.winfo_rootx()
        geoy=fen1.winfo_rooty() 
        fenbul.geometry("50x19+"+str(geox+33)+"+"+str(geoy+97))
        fenbul.resizable(width=False, height=False)
        fenbul.overrideredirect(1)
        lab1=Label(fenbul,bg='yellow', fg='black',width=15,font=('Arial', 8),text="ENTREE",relief=RIDGE)
        lab1.pack()
     
    def touche_can2(e):
        global fenbul,mot2,mes2
        can2.config(cursor='hand2')
        fenbul=Toplevel()
        fenbul.config(bg='yellow')
        geo1=fen1.winfo_geometry()
        geox=fen1.winfo_rootx()
        geoy=fen1.winfo_rooty() 
        fenbul.geometry("50x19+"+str(geox+33)+"+"+str(geoy+177))
        fenbul.resizable(width=False, height=False)
        fenbul.overrideredirect(1)
        lab2=Label(fenbul,bg='yellow', fg='black',width=15,font=('Arial', 8),text="PLAT",relief=RIDGE)
        lab2.pack()
     
    def touche_can3(e):
        global fenbul,mot3,mes3
        can3.config(cursor='hand2')
        fenbul=Toplevel()
        fenbul.config(bg='yellow')
        geo1=fen1.winfo_geometry()
        geox=fen1.winfo_rootx()
        geoy=fen1.winfo_rooty() 
        fenbul.geometry("50x19+"+str(geox+33)+"+"+str(geoy+257))
        fenbul.resizable(width=False, height=False)
        fenbul.overrideredirect(1)
        lab3=Label(fenbul,bg='yellow', fg='black',width=15,font=('Arial', 8),text="BOISSON",relief=RIDGE)
        lab3.pack()
     
    def touche_can4(e):
        global fenbul,mot4,mes4
        can4.config(cursor='hand2')
        fenbul=Toplevel()
        fenbul.config(bg='yellow')
        geo1=fen1.winfo_geometry()
        geox=fen1.winfo_rootx()
        geoy=fen1.winfo_rooty() 
        fenbul.geometry("50x19+"+str(geox+33)+"+"+str(geoy+337))
        fenbul.resizable(width=False, height=False)
        fenbul.overrideredirect(1)
        lab4=Label(fenbul,bg='yellow', fg='black',width=15,font=('Arial', 8),text="DESSERT",relief=RIDGE)
        lab4.pack()
     
    def fleche(e) :
        restau()
     
    def restau() :
        global fenbul
        fen1.config(cursor='arrow')
        fenbul.destroy()
     
     
    def modifier():
        global total
        memo.delete(0,END)
        total=0
        fic = open('liste.txt','w')
        fic.close()
     
    def quitter_prog() :
        global fenqui    
        fenqui=Toplevel()
        fenqui.config(bg='yellow',bd=3,relief='groove')
        geo1=fen1.winfo_geometry()
        geox=fen1.winfo_rootx()
        geoy=fen1.winfo_rooty() 
        fenqui.geometry("150x60+"+str(geox+220)+"+"+str(geoy+160))
        fenqui.resizable(width=False, height=False)
        fenqui.overrideredirect(1)
        labqui=Label(fenqui,bg='yellow',fg='red',font=('Arial', 10),text="Quitter Commande?")
        labqui.place(x=17,y=1)
        repon=StringVar()
        bououi=Button(fenqui,text="Oui", bg='pink', fg='black',command=confir_quitter)
        bounon=Button(fenqui,text="Non", bg='pink', fg='black',command=continu_prog)
        bououi.place(x=20,y=25)
        bounon.place(x=90,y=25)
     
     
    def confir_quitter() :
        fenqui.destroy()
        global fenenv
        fenenv=Toplevel()
        geo1=fen1.winfo_geometry()
        geox=fen1.winfo_rootx()
        geoy=fen1.winfo_rooty() 
        fenenv.geometry("230x55+"+str(geox+13)+"+"+str(geoy+130))
        labenv=Label(fenenv,bg='yellow',fg='blue',width=30,font=('Arial', 10),text="Les commendes sont envoyees.")
        labenv.place(x=1,y=1)
        bouenv=Button(fenenv,text="OK", fg='blue',command=reussir).pack(side=BOTTOM,pady=3)
     
     
    def continu_prog() :
        global fenqui
        fenqui.destroy()
     
    def ordre():
        global ent,fenord
        fenord=Toplevel()
        geo1=fen1.winfo_geometry()
        geox=fen1.winfo_rootx()
        geoy=fen1.winfo_rooty() 
        fenord.geometry("217x30+"+str(geox-2)+"+"+str(geoy-85))
        Label(fenord, text="NUMERO: ").grid(row=0, sticky=W)
        ent = Entry(fenord)
        ent.grid(row=0, column=1)
        Button(fenord, text="OK", command = numeroter).grid(row = 0, column = 2)
     
    def numeroter():
        global no
        no=0
        no=int(ent.get())
        fenord.destroy()
        numero.configure(text=str(no).capitalize())
        print no
     
    def reussir() :
        fenenv.destroy()
     
     
    fen1 = Tk(className='Resto')
    fen1.resizable(width=False, height=False)
    fen1.geometry("400x600")
    fen1.iconbitmap("resto.ico")
     
    fram1=Frame(fen1,bg='grey',bd=2,relief='ridge',width=400, height=300)
    fram1.pack(fill=BOTH,expand=1)
     
    fram2=Frame(fen1,bg='grey',bd=2,relief='ridge',width=400, height=300)
    fram2.pack(fill=BOTH,expand=1)
    scrolly =Scrollbar(fram2,orient=VERTICAL)
    memo = Listbox(fram2,width=31,height=12, yscrollcommand=scrolly.set, font=('Lucida Console', 9))
    scrolly.config(command  = memo.yview)
    scrolly.pack(side=LEFT,fill=Y)
    memo.pack()
     
    boutonnu=Button(fram2, text='NUMERO', bg='lightblue', command= ordre, fg='blue')
    boutonnu.place(x=320,y=2)
    numero=Label(fram2,text='   ',bg='#80c0c0',font=('times',11,'bold'))
    numero.place(x=377,y=2)
     
    boutonva=Button(fram2, text="VALIDER", command=quitter_prog, bg='lightblue', fg='blue')
    boutonva.place(x=235,y=188)
    boutonsu=Button(fram2, text="MODIFIER", command=modifier, bg='lightblue', fg='blue')
    boutonsu.place(x=125,y=188)
    fic = open('liste.txt','w')
    fic = open('liste.txt','a')
    fic.write("numero du client/article/prix/addition")
    fic.write("\n")
    fic.close()
     
     
    can1 = Canvas(fram1, width=50, height=50)
    signat1=PhotoImage(file='entree.gif')
    sign1=can1.create_image(20,30, image=signat1,tag="entree")
    can1.tag_bind("entree","<Enter>",touche_can1)
    can1.tag_bind("entree","<Leave>",fleche)
    can1.place(x=30,y=40)
     
    can2 = Canvas(fram1, width=50, height=50)
    signat2=PhotoImage(file='plat.gif')
    sign2=can2.create_image(30,30, image=signat2,tag="plat")
    can2.tag_bind("plat","<Enter>",touche_can2)
    can2.tag_bind("plat","<Leave>",fleche)
    can2.place(x=30,y=120)
     
    can3 = Canvas(fram1, width=50, height=50)
    signat3=PhotoImage(file='boisson.gif')
    sign3=can3.create_image(20,37, image=signat3,tag="boisson")
    can3.tag_bind("boisson","<Enter>",touche_can3)
    can3.tag_bind("boisson","<Leave>",fleche)
    can3.place(x=30,y=200)
     
    can4 = Canvas(fram1, width=50, height=50)
    signat4=PhotoImage(file='dessert.gif')
    sign4=can4.create_image(20,37, image=signat4,tag="dessert")
    can4.tag_bind("dessert","<Enter>",touche_can4)
    can4.tag_bind("dessert","<Leave>",fleche)
    can4.place(x=30,y=280)
     
    class Plat:
        def __init__(self,nom,prix):
            self.nom=nom
            self.prix=prix
            self.bouton=Button(fram1, text=self.nom, bg='gold', command= self.commander, fg='blue')
     
        def commander(self):
            global total
            total=total + self.prix
            self.mot1=self.nom+ " / " + str(self.prix) 
            mots.append(self.mot1)
            memo.insert(0,self.mot1)
            fic = open('liste.txt','a')
            fic.write(str(no) + " / " + self.mot1 + " / "+str(total) + "\n")
            fic.close()        
            print self.mot1,total
     
     
    e1=Plat('ENTR1',3.1)
    e1.bouton.place(x=130,y=50)
    e2=Plat('ENTR2',3.4)
    e2.bouton.place(x=190,y=50)
    e3=Plat('ENTR3',3.7)
    e3.bouton.place(x=250,y=50)
     
    p1=Plat('PLAT1',7.2)
    p1.bouton.place(x=130,y=130)
    p2=Plat('PLAT2',7.5)
    p2.bouton.place(x=190,y=130)
    p3=Plat('PLAT3',7.8)
    p3.bouton.place(x=250,y=130)
     
    b1=Plat('BOIS1',2.2)
    b1.bouton.place(x=130,y=210)
    b2=Plat('BOIS2',9.9)
    b2.bouton.place(x=190,y=210)
    b3=Plat('BOIS3',5.5)
    b3.bouton.place(x=250,y=210)
     
    d1=Plat('DESS1',6.3)
    d1.bouton.place(x=130,y=290)
    d2=Plat('DESS2',6.6)
    d2.bouton.place(x=190,y=290)
    d3=Plat('DESS3',6.9)
    d3.bouton.place(x=250,y=290)
     
     
    fen1.mainloop()

Discussions similaires

  1. Comment accélérer(simplifier) cette procédure
    Par sedam dans le forum Macros et VBA Excel
    Réponses: 6
    Dernier message: 08/08/2009, 22h48
  2. Requête imbriquée, comment la simplifier ?
    Par Barbutan dans le forum Requêtes
    Réponses: 7
    Dernier message: 12/06/2009, 08h11
  3. Macro ouverture Fichier puis enregistrement : Comment la simplifier ?
    Par mattwarend dans le forum Macros et VBA Excel
    Réponses: 3
    Dernier message: 21/11/2008, 11h02
  4. [BATCH] Comment se simplifier la vie?
    Par LoLoLem dans le forum Autres Logiciels
    Réponses: 3
    Dernier message: 29/03/2006, 13h57

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo