from tkinter import *
root= Tk()
# window config here
btn = Button(root, text="Start", command="toggle").pack()
def toggle():
if btn.config('text')[-1] == 'Start':
btn.config('text')[-1] == 'Stop'
elif btn.config('text')[-1] == 'Stop':
btn.config('text')[-1] == 'Start'
while btn.config('text')[-1] == 'Stop': # Error throws here
print('click')
root.mainloop()
It keeps throwing AttributeError: 'NoneType' object has no attribute 'config' regarding commented line
0 comments:
Post a Comment
Thanks