Here is my code for debugging:
from tkinter import *
window = Tk()
b1 = window.button(window,text="Dark",command=window.configure(bg='black'))
window.mainloop()
I want to add a button to set the bg color to black. Pretty simple. But it gives an error:
Traceback (most recent call last):
File "C:/Users/----/Downloads/windows.py", line 3, in <module>
b1 = window.button(window,text="Dark",command=window.configure(bg='black'))
File "C:\Users\----\AppData\Local\Programs\Python\Python310\lib\tkinter\__init__.py", line 2383, in __getattr__
return getattr(self.tk, attr)
AttributeError: '_tkinter.tkapp' object has no attribute 'button'
I'm not sure how to fix this.