Bonjour à tous
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 :
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
Si vous pouvez m'aider, ça serait vraiment sympa
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
Si vous pouvez m'aider, ça serait vraiment sympa