Setting global variables between classes with tKinter
<p>I am currently struggling to use input derived from another class (which uses tkinter) to alter outputs in a different class. This is my code:</p>

<pre><code>#there are many of these defs, this is just one i used as an example

    def command_ssumowrestler(self):
        self.master.withdraw()
        toplevel = tk.Toplevel(self.master)
        toplevel.geometry("30x70")
        app=ClassConfirmation(toplevel)
        global cs_hobby
        cs_hobby = 'sumo_wrestler'

class ClassConfirmation:
    def __init__ (self, master):
        self.master = master
        self.frame = tk.Frame(self.master)
        confirmclass_label = tk.Label(master, width = 20, fg = 'blue',text= "Do You Wish to Proceed as:")
        confirmclass_label.pack()

#here i use the variable defined and set globally in the previously block, which always leaves me with an error saying cs_hobby is not defined 

        classdescription_label = tk.Label(master, width =50, text='test ' + cs_hobby + ' hello')
        classdescription_label.pack()
        self.confirmclassButton = tk.Button(self.frame, text = 'Confirm', width = 20, command = self.close_windows)
        self.confirmclassButton.pack()
        self.frame.pack()
    def close_windows (self):
        self.master.withdraw()
        app=dragonrealmP1
#this just opens a different class
</code></pre>