I'm trying to create a class of buttons and bind it to tkinter but it keeps telling me "NameError: name 'frame' is not defined."
I tried this solution here but it's not working - https://stackoverflow.com/questions/4625...ned-python
Here's what it looks like:
I tried this solution here but it's not working - https://stackoverflow.com/questions/4625...ned-python
Here's what it looks like:
>>> class AccountingButtons: def __init__(self, master): frame = Frame(master) frame.pack() >>> self.incomeopButton = Button(frame, text="Display Income From Operations", command=self.income_from_operations) Traceback (most recent call last): File "<pyshell#76>", line 1, in <module> self.incomeopButton = Button(frame, text="Display Income From Operations", command=self.income_from_operations) NameError: name 'frame' is not defined >>> from tkinter import Frame >>> from tkinter import Text >>> from tkinter import Label >>> class AccountingButtons: def __init__(self, master): frame = Frame(master) frame.pack() >>> self.incomeopButton = Button(frame, text="Display Income From Operations", command=self.income_from_operations) Traceback (most recent call last): File "<pyshell#86>", line 1, in <module> self.incomeopButton = Button(frame, text="Display Income From Operations", command=self.income_from_operations) NameError: name 'frame' is not defined