Feb-24-2021, 06:39 PM
Hello!
Can anyone help me? I dont know why but it just litearly skips gamemain(). :/
Currently there are no errors in the code.
Can anyone help me? I dont know why but it just litearly skips gamemain(). :/

from tkinter import * import random import tkinter import time def gamemain(): #It skips this code gametext0 = Label(root , text = "1") gametext1 = Label(root , text ="2") gametext2 = Label(root, text ="3") gametext3 = Label(root , text = "4") gameinput0 = Entry(root , width=50, borderwidth=5) enter = Button(root, text = "Name your self", command = main()) gametext0.pack() gametext1.pack() gametext2.pack() gametext3.pack() gameinput0.pack() enter.pack() root.mainloop() def main():#and goes straight to this root.destroy() window = Toplevel() time.sleep(8) gametext0 = Label(window , text = "5") gametext1 = Label(window , text = "6") gametext2 = Label(window , text = "7") gametext3 = Label(window , text = "8") gametext4 = Label(window , text = "9") gametext5 = Label(window , text = "10") gametext0.pack() gametext1.pack() gametext2.pack() gametext3.pack() gametext4.pack() gametext5.pack() window.mainloop() def start1(): global root root = Toplevel() def securitycheck(): if secCheck.get() == "123": print("Lets go!") command = gamemain() else: print("Nope. Invalid.") secCheckt = Label(root, text="Please show me your lisence mister:") secCheck = Entry(root, width=50, borderwidth=5) secCHK = Button(root, text = "Check", command = securitycheck) secCheckt.pack() secCheck.pack() secCHK.pack() secCheck.insert(0, "Code") root.mainloop() def close(): exit() print("Game") global root root = Tk() root.geometry = "100X100" buttonA = Button(root, text="START", command=start1) buttonB = Button(root, text="CLOSE", command=close) buttonA.pack() buttonB.pack() root.mainloop()Any help
