Erreur de synthaxe

Arustat Messages postés 1 Date d'inscription   Statut Membre Dernière intervention   -  
Phil_1857 Messages postés 1872 Date d'inscription   Statut Membre Dernière intervention   -
Bonjour,
J'ai un problème avec mon programme il ne marche plus alors que hier soir il marchait très bien, je ne comprend absolument pas l'erreur puisque je n'ai pas modifié le programme.
C'est un problème de synthaxe ma fonction accueil n'est pas définie ? Bref, mieux vaux que je vous montre :

from tkinter import*

global Mafenetre, fen2

def detruite():
    global Mafenetre,fen2
    Mafenetre.destroy()
    accueil()

    
def fenetre():
    global Mafenetre
    Mafenetre = Tk()
    Mafenetre.resizable(height = False , width = False)
    Mafenetre.title("Anigator")
    
    Mafenetre.geometry('1080x720')
    Mafenetre.minsize(1080,720)
    Mafenetre.iconbitmap("Logo.ico")

    Canevas = Canvas(Mafenetre)
    Canevas.pack(padx = 5,pady =5)
    photo = PhotoImage(file="Ima1.gif")
    background=Label(Mafenetre, image=photo)
    background.place(x=0,y=0,relwidth=1,relheight=1)

    start = PhotoImage(file = 'start.png' )
    button = Button(Mafenetre, image=start, command = detruite)
    button.place(x=740,y=540)
    Label(Mafenetre, text="").pack()
    Mafenetre.mainloop()

def acceuil():
    global fen2
    fen2 = Tk()
    fen2.resizable(height = False , width = False)
    fen2.title("Anigator")
    fen2.geometry("1080x720")
    fen2.minsize(1080,720)
    fen2.iconbitmap("Logo.ico")

    fond = PhotoImage(file="fond.gif")
    background2=Label(fen2, image=fond)
    background2.place(x=0,y=0,relwidth=1,relheight=1)

if __name__ == '__main__':
    fenetre()




Configuration: Windows / Chrome 101.0.4951.67

2 réponses

jordane45 Messages postés 38486 Date d'inscription   Statut Modérateur Dernière intervention   4 752
 
Bonjour,

C'est le problème quand on est dyslexique .. :-)
Regarde bien le nom de ta fonction... et la ligne ou tu l'appelles ...

0
Phil_1857 Messages postés 1872 Date d'inscription   Statut Membre Dernière intervention   168
 
Bonjour,

Pour éviter ce genre de truc, Il aurait fallu faire un copié/collé :-)
0