Is it bad practise and/or is there a better way to be able to access function variables than this:
class Start_up:
def __init__( self ):
self.root = Tk()
self.user_entry = StringVar()
self.change = StringVar()
self.label = Label ( self.root, textvariable = self.change )
self.entry = Entry ( self.root, textvaribale = self.user_entry )
self.button = Button ( self.root, text="Buttton", command = self.doSomething )
def doSomething( self ):
self.change.set("Text Changed")
got_it = self.user_entry.get()
I'm wondering if there is a way for these functions to work exactly the same but without the class being there?
Thank you in advance for any help, I've looked around but cant find precisely this example with TKinter.