Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.

Communauté non-officielle autour du langage Python

-28%
Le deal à ne pas rater :
Brandt LVE127J – Lave-vaisselle encastrable 12 couverts – L60cm
279.99 € 390.99 €
Voir le deal

2 participants

    Script Ultimate Bravery

    Valou
    Valou
    Bogoss du Blitzcrank


    Messages : 29
    Date d'inscription : 30/01/2013
    Age : 29
    Localisation : France

    Script Ultimate Bravery Empty Script Ultimate Bravery

    Message par Valou Ven 15 Mar - 23:56

    Bonjour à tous Very Happy

    Je souhaite faire un logiciel appelé "Ultimate Bravery" se rapprochant de ceci. Ultimate Bravery consiste à s'en remettre à un ordinateur pour savoir quel personnage on va jouer dans la prochaine partie. La particularité de ce logiciel, est de proposer un personnage, les objets, enfin tout ALEATOIREMENT. De ce fait, on se retrouve avec des choses plus folles les unes que les autres.
    Le mieux est de faire ça entre potes, c'est plutôt festif. Et bien sûr, si vous gagnez, vous serez un brave, vous aurez braver la league ! ^^

    Voici le script :
    Code:
    from tkinter import *
    from random import randrange

    def ultimate():
       liste_champ=["Alistar", "Blitzcrank", "Janna", "Karma", "Kayle", "Leona", "Lulu", "Nami", "Nunu", "Sona", "Soraka", "Taric", "Thresh", "Zilean"]
       nombre=randrange(14)
       nombre=liste_champ[nombre]
       mot=Label(fen, text=nombre)
       mot.pack()
       if nombre=="Alistar":
          photo=PhotoImage(file="alistar.gif")
          alistar=Label(fen, image=photo)
          alistar.pack()
       if nombre=="Blitzcrank":
          photo=PhotoImage(file="blitzcrank.gif")
          blitzcrank=Label(fen, image=photo)
          blitzcrank.pack()
       if nombre=="Janna":
          photo=PhotoImage(file="janna.gif")
          janna=Label(fen, image=photo)
          janna.pack()
       if nombre=="Karma":
          photo=PhotoImage(file="karma.gif")
          karma=Label(fen, image=photo)
          karma.pack()
       if nombre=="Leona":
          photo=PhotoImage(file="leona.gif")
          leona=Label(fen, image=photo)
          leona.pack()
       if nombre=="Lulu":
          photo=PhotoImage(file="lulu.gif")
          lulu=Label(fen, image=photo)
          lulu.pack()
       if nombre=="Nami":
          photo=PhotoImage(file="nami.gif")
          nami=Label(fen, image=photo)
          nami.pack()
       if nombre=="Nunu":
          photo=PhotoImage(file="nunu.gif")
          nunu=Label(fen, image=photo)
          nunu.pack()
       if nombre=="Sona":
          photo=PhotoImage(file="sona.gif")
          sona=Label(fen, image=photo)
          sona.pack()
       if nombre=="Soraka":
          photo=PhotoImage(file="soraka.gif")
          soraka=Label(fen, image=photo)
          soraka.pack()
       if nombre=="Taric":
          photo=PhotoImage(file="taric.gif")
          taric=Label(fen, image=photo)
          taric.pack()
       if nombre=="Thresh":
          photo=PhotoImage(file="thresh.gif")
          thresh=Label(fen, image=photo)
          thresh.pack()
       if nombre=="Zilean":
          photo=PhotoImage(file="zilean.gif")
          zilean=Label(fen, image=photo)
          zilean.pack()
       Label(fen, text="").pack()
       slogan=Label(fen, text="DEMACIA !")
       slogan.pack()

    fen=Tk()
    fen.title("ULTIMATE BRAVERY version ValBlitz")
    cadre = Frame(fen, width=450, height=1, borderwidth=1)
    button= Button(fen,text="Je suis brave !",command=ultimate)
    button.pack()
    cadre.pack()
    fen.mainloop()

    Voici mon problème :
    Mon logiciel marche mais lorsque j'appuie sur le bouton, une image est censée s'afficher. Ce qui n'est pas le cas.
    Je ne comprends pas pourquoi il ne veut pas m'afficher cette foutue photo Very Happy

    Si vous pouvez m'aider, ça serait vraiment sympa Smile
    Jule04
    Jule04
    Pyministrateur


    Messages : 98
    Date d'inscription : 15/01/2013
    Age : 28
    Localisation : Orléans

    Script Ultimate Bravery Empty Re: Script Ultimate Bravery

    Message par Jule04 Sam 16 Mar - 0:00

    Quel erreur t'affiche Python ?
    Valou
    Valou
    Bogoss du Blitzcrank


    Messages : 29
    Date d'inscription : 30/01/2013
    Age : 29
    Localisation : France

    Script Ultimate Bravery Empty Re: Script Ultimate Bravery

    Message par Valou Sam 16 Mar - 0:22

    Justement, aucune Very Happy

    ça me fait ça :
    Script Ultimate Bravery Erreur12

    Contenu sponsorisé


    Script Ultimate Bravery Empty Re: Script Ultimate Bravery

    Message par Contenu sponsorisé

      Sujets similaires

      -

      La date/heure actuelle est Sam 27 Avr - 4:39