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:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
>>> 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 |