def buttonWeiterClick(y):
def skip():
buttonWeiterClick(1)
if y == 1:
x = ampel.getZustand()
print(x,y)
anzeigeAktualisieren(x,y)
ampel.schalten()
ampel2.schalten()
fenster.after(3000, skip)
elif y == 2:
print("Crashed")
I got a function which calls himself constantly via an .after Statement and I want to know if and how I can end this loop for example via a Button?