Apr-07-2018, 06:49 PM
whenever i hit the exit button it gives me this error
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\saba_\AppData\Local\Programs\Python\Python36-32\lib\tkinter\__init__.py", line 1702, in __call__
return self.func(*args)
File "C:\Users\saba_\Desktop\python\clickerHero.py", line 39, in exit
exit()
File "C:\Users\saba_\Desktop\python\clickerHero.py", line 39, in exit
exit()
File "C:\Users\saba_\Desktop\python\clickerHero.py", line 39, in exit
exit()
[Previous line repeated 985 more times]
RecursionError: maximum recursion depth exceeded
code below
import tkinter as tk
import time
from pynput.mouse import Button, Controller
#creates the window
root = tk.Tk()
root.geometry("600x400")
root.title("attempt1")
#global var
mouse = Controller()
startClickingVar = 0
#def
def startClick():
if startClickingVar == 0:
startClickingVar = 1
while startClickingVar == 1:
time.sleep(1)
mouse.click(Button.left, 1)
time.sleep(1)
else:
pass
def stopClick():
if startClickingVar == 1:
startClickingVar = 0
else:
pass
def exit():
exit()
#
#lables
welcomingLable = tk.Label(root, text="Hi, Welocme to Hero Clicker AutoClicker", font=("arial", 20, "bold"), fg = "blue")
welcomingLable.pack(side=tk.TOP)
#buttons
start = tk.Button(root, text="start", width=25, bg="lightgreen", command=startClick)
start.place(x=50, y=140)
stop = tk.Button(root,text="stop", width = 25, bg="red", command=stopClick)
stop.place(x=350, y=140)
exitButton = tk.Button(root, text="Exit", width = 25, bg="red", command=exit)
exitButton.place(x=200, y=180)
#enterys
numberOfClicks = 1
enterCardInfo = tk.Entry(root, textvariable= numberOfClicks, width=50, bg="orange",)
enterCardInfo.place(x=150, y=100)
# has to stay below so everthing runs within
root.mainloop()
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\saba_\AppData\Local\Programs\Python\Python36-32\lib\tkinter\__init__.py", line 1702, in __call__
return self.func(*args)
File "C:\Users\saba_\Desktop\python\clickerHero.py", line 39, in exit
exit()
File "C:\Users\saba_\Desktop\python\clickerHero.py", line 39, in exit
exit()
File "C:\Users\saba_\Desktop\python\clickerHero.py", line 39, in exit
exit()
[Previous line repeated 985 more times]
RecursionError: maximum recursion depth exceeded
code below
import tkinter as tk
import time
from pynput.mouse import Button, Controller
#creates the window
root = tk.Tk()
root.geometry("600x400")
root.title("attempt1")
#global var
mouse = Controller()
startClickingVar = 0
#def
def startClick():
if startClickingVar == 0:
startClickingVar = 1
while startClickingVar == 1:
time.sleep(1)
mouse.click(Button.left, 1)
time.sleep(1)
else:
pass
def stopClick():
if startClickingVar == 1:
startClickingVar = 0
else:
pass
def exit():
exit()
#
#lables
welcomingLable = tk.Label(root, text="Hi, Welocme to Hero Clicker AutoClicker", font=("arial", 20, "bold"), fg = "blue")
welcomingLable.pack(side=tk.TOP)
#buttons
start = tk.Button(root, text="start", width=25, bg="lightgreen", command=startClick)
start.place(x=50, y=140)
stop = tk.Button(root,text="stop", width = 25, bg="red", command=stopClick)
stop.place(x=350, y=140)
exitButton = tk.Button(root, text="Exit", width = 25, bg="red", command=exit)
exitButton.place(x=200, y=180)
#enterys
numberOfClicks = 1
enterCardInfo = tk.Entry(root, textvariable= numberOfClicks, width=50, bg="orange",)
enterCardInfo.place(x=150, y=100)
# has to stay below so everthing runs within
root.mainloop()