Weitere Befehle schreiben

Wenn der Spieler den „fertig“-Button betätigt oder nach dem dritten Wurf, soll das Ergebnis des Wurfs ausgewertet werden.
und wie implementiere ich eine Funktion auswertung, die dem Spieler das Ergebnis seines Wurfs anzeigt, also Kniffel, Full House, eine Straße oder einen Pasch. Dieses Ergebnis soll dann im Label unterhalb des Wortes „Würfelergebnis“ stehen… :weary: :sob: :sob: :sob: :sob:

ich bin halt wirklich eine 0 in informatik… und verstehe auch nicht mehr was sache ist… mein lehrer hat nie erklärt, was was ist usw… wir mussten einfach die aufgaben machen und deshalb bin ich jetzt mehr als aufgeschmissen… bitte helft mir…

   import random
from tkinter import *

def zuruecksetzen():
checkbutton0.config(state='active')
checkbutton1.config(state='active')
checkbutton2.config(state='active')
checkbutton3.config(state='active')
checkbutton4.config(state='active')
labelW1.config(text=str(random.randint(1,6)))
labelW2.config(text=str(random.randint(1,6)))
labelW3.config(text=str(random.randint(1,6)))
labelW4.config(text=str(random.randint(1,6)))
labelW5.config(text=str(random.randint(1,6)))
labelWurf.config(text="1. Wurf")
labelAuswertung.config(text=" ")
labelEintragen.config(text=" ")
summieren()

def auswahlClick():
buttonWuerfeln.config(state='active')

def buttonWuerfelnClick():
if wert0.get() == 1:
    labelW1.config(text=str(random.randint(1,6)))
else:
    checkbutton0.config(state='disabled')
if wert1.get() == 1:
    labelW2.config(text=str(random.randint(1,6)))
else:
    checkbutton1.config(state='disabled')
if wert2.get() == 1:
    labelW3.config(text=str(random.randint(1,6)))
else:
    checkbutton2.config(state='disabled')
if wert3.get() == 1:
    labelW4.config(text=str(random.randint(1,6)))
else:
    checkbutton3.config(state='disabled')
if wert4.get() == 1:
    labelW5.config(text=str(random.randint(1,6)))
else:
    checkbutton4.config(state='disabled')
checkbutton0.deselect()
checkbutton1.deselect()
checkbutton2.deselect()
checkbutton3.deselect()
checkbutton4.deselect()
buttonWuerfeln.config(state='disabled')
if labelWurf.cget("text")=="1. Wurf":
    labelWurf.config(text="2. Wurf")
elif labelWurf.cget("text")=="2. Wurf":
    labelWurf.config(text="3. Wurf")
    checkbutton0.config(state='disabled')
    checkbutton1.config(state='disabled')
    checkbutton2.config(state='disabled')
    checkbutton3.config(state='disabled')
    checkbutton4.config(state='disabled')

def buttonFertigClick():
pass


# Fenster
tkFenster = Tk()
tkFenster.title('Kniffel')
tkFenster.geometry('220x390')

# Frames
frameWuerfel = Frame(master=tkFenster, bg="white")
frameWuerfel.place(x=10, y=10, width=210, height=80)
frameAuswahl = Frame(master=tkFenster, bg="white")
frameAuswahl.place(x=10, y=100, width=210, height=170)
frameAuswertung = Frame(master=tkFenster, bg="white")
frameAuswertung.place(x=10, y=280, width=210, height=100)


# Label
labelWurf = Label (master=frameWuerfel, text="1. Wurf")
labelWurf.place(x=10, y=10, width=100, height=20)
labelW1 = Label(master=frameWuerfel, bg="gray", text=str(random.randint(1,6)))
labelW1.place(x=10, y=40, width=30, height=30)
labelW2 = Label(master=frameWuerfel, bg="gray", text=str(random.randint(1,6)))
labelW2.place(x=50, y=40, width=30, height=30)
labelW3 = Label(master=frameWuerfel, bg="gray", text=str(random.randint(1,6)))
labelW3.place(x=90, y=40, width=30, height=30)
labelW4 = Label(master=frameWuerfel, bg="gray", text=str(random.randint(1,6)))
labelW4.place(x=130, y=40, width=30, height=30)
labelW5 = Label(master=frameWuerfel, bg="gray", text=str(random.randint(1,6)))
labelW5.place(x=170, y=40, width=30, height=30)

labelFrage = Label (master=frameAuswahl, text="Welche Würfel sollen\n neu gewürfel werden?")
labelFrage.place(x=10, y=10, width=190, height=50)

labelErgebnis = Label(master=frameAuswertung, text="Würfelergebnis:")
labelErgebnis.place(x=10, y=10, width=190, height=20)
labelAuswertung = Label(master=frameAuswertung, text="")
labelAuswertung.place(x=10, y=30, width=190, height=20)
labelEintragen = Label(master=frameAuswertung, text="")
labelEintragen.place(x=10, y=50, width=190, height=40)



# Kontrollvariablen
wert0 = IntVar()
wert1 = IntVar()
wert2 = IntVar()
wert3 = IntVar()
wert4 = IntVar()

# Checkbutton
checkbutton0 = Checkbutton(master=frameAuswahl, bg="white", anchor='w', offvalue=0,        onvalue=1, variable=wert0, command=auswahlClick)
checkbutton0.place(x=15, y=65, width=20, height=20)
checkbutton1 = Checkbutton(master=frameAuswahl, bg="white", anchor='w', offvalue=0,     onvalue=1, variable=wert1, command=auswahlClick)
checkbutton1.place(x=55, y=65, width=20, height=20)
checkbutton2 = Checkbutton(master=frameAuswahl, bg="white", anchor='w', offvalue=0, onvalue=1, variable=wert2, command=auswahlClick)
checkbutton2.place(x=95, y=65, width=20, height=20)
checkbutton3 = Checkbutton(master=frameAuswahl, bg="white", anchor='w', offvalue=0, onvalue=1, variable=wert3, command=auswahlClick)
checkbutton3.place(x=135, y=65, width=20, height=20)
checkbutton4 = Checkbutton(master=frameAuswahl, bg="white", anchor='w', offvalue=0, onvalue=1, variable=wert4, command=auswahlClick)
checkbutton4.place(x=175, y=65, width=20, height=20)

# Button
buttonWuerfeln = Button (master=frameAuswahl, text="neu würfeln",   command=buttonWuerfelnClick, state='disabled')
buttonWuerfeln.place(x=10, y=95, width=190, height=30)
buttonFertig = Button (master=frameAuswahl, text="fertig", command=buttonFertigClick)
buttonFertig.place(x=10, y=130, width=190, height=30)

# Aktivierung des Fensters
tkFenster.mainloop()

gelöst, Doppel posting ggfs. löschen