Bonjour j'ai un probleme avec ce code lorsque je lance la fonction choice en elle meme ell fonctionne cependant lorsqu'elle est appelée dans la fonction prtphase cela me marque le message d'erreur suivant :
<< File "C:\Users\Elie\Desktop\projet2.0.py", line 232, in prtphase
choice()
File "C:\Users\Elie\Desktop\projet2.0.py", line 214, in choice
X=int(x.get())
ValueError: invalid literal for int() with base 10: '' >>

Voici le dit programme :

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
def choice():
    choix = tki.Tk()  
    x = tki.StringVar()  
    z = tki.StringVar()  
    xz = tki.StringVar()
    Title = tki.Label(choix, text="Selon quels axes voulez vous les courbes ? ")
    Title.pack()
    chkbtn1 = tki.Checkbutton(choix, text = "X", variable = x, onvalue=1, offvalue=0)
    chkbtn1.deselect()
    chkbtn1.pack()
    chkbtn2 = tki.Checkbutton(choix, text = "Z", variable = z, onvalue=1, offvalue=0)
    chkbtn2.deselect()
    chkbtn2.pack()
    chkbtn3 = tki.Checkbutton(choix, text = "X et Z", variable = xz, onvalue=1, offvalue=0)  
    chkbtn3.deselect()
    chkbtn3.pack()
    bouton_entree = tki.Button(choix, text="Entrée", command = choix.destroy )
    bouton_entree.pack()
    choix.mainloop()
    X=int(x.get())
    Z=int(z.get())
    XZ=int(xz.get())
 
def prtphase(t, Lx, Lz):
    tv = []
    vX, vZ = deriv(Lx, t), deriv(Lz, t)
    aX, aZ = deriv(vX, t), deriv(vZ, t)
    xadapt, zadapt, vxadapt, vzadapt = [], [], [], []
    for i in range(1,len(t)-1):
        tv.append(t[i])
    for i in range (1,len(Lx)-1):
        xadapt.append(Lx[i])
        zadapt.append(Lz[i])
    for i in range (1,len(vX)-1):
        vxadapt.append(vX[i])
        vzadapt.append(vZ[i])
        choice()
Comment faire ?
Merci beaucoup pour votre aide.