title: Is there a way of accessing the methods variables without calling the method?
body: <p>I want to make a simple GUI that will allow user to pick an excel file to load the data from that will later be used for math calculations. Both modules work correctly when separate. But when I try to use my GUI as an import into my main file I am unable to access the needed var without calling the class method which in turn iterates it. It is troublesome because it is supposed to use this function only after the button press. </p>
  
  <p>Is there something fundamentally wrong that I am doing? </p>
  
  <p>GUI script</p>
  
  <pre class="lang-py prettyprint-override"><code>import tkinter as tk
  import tkinter.filedialog as tkf
  
  class TestClass():
      def __init__(self, master):
          frame = tk.Frame(master)
          frame.pack()
  
          self.dialogButton = tk.Button(frame, text="choose", command=self.chooseFile)
          self.dialogButton.pack(side=tk.BOTTOM)
  
      def chooseFile(self):
          global filename
          filename = tkf.askopenfilename()
          print(filename)
  </code></pre>
  
  <p>Import script</p>
  
  <pre class="lang-py prettyprint-override"><code>import tkinterTest as tt
  import tkinter as tk
  
  root = tk.Tk()
  
  classObject = tt.TestClass(root)
  var = classObject.chooseFile()
  print(var)
  
  root.mainloop()
  </code></pre>
  
  <p>I want to access the path string only with the GUI so that it gives me the string only after I press the button to select the file not right after the program starts.</p>