title: Passing variables between two windows Tkinter
body: <p>I posted something about this earlier and how a response which I thought solved my issue but it didn't fully solve it. Basically, I'm looking for a way to pass StringVar() from my first method called 'main_frame' to my second method called 'result_frame' when the button in the 'main_frame' method is clicked. </p>
  
  <pre><code>from Tkinter import *
  import Forecast
  
  
  class Frames(object):
  
      def __init__(self):
          pass
  
      def main_frame(self):
          root = Tk()
          root.title('WeatherMe')
          root.geometry('300x100')
  
          query = StringVar()
  
          Label(root, text='Enter a city below').pack()
  
          Entry(root, textvariable=query).pack()
  
          Button(root, text="Submit", command=self.result_frame).pack()
  
          root.mainloop()
  
      def result_frame(self):
          result = Toplevel()
          result.title('City')
          result.geometry('1600x150')
  
          forecast = Forecast.GetWeather('City Here').fetch_weather()
  
          Label(result, text='1-3 DAY: \n' + forecast[0]).pack()
          Label(result, text='4-7 DAY: \n' + forecast[1]).pack()
          Label(result, text='8-10 DAY: \n' + forecast[2]).pack()
  
          Button(result, text="OK", command=result.destroy).pack()
  </code></pre>
  
  <p>As you can see one window will have an Entry box where you can type in a city. The entry will save it's contents to StringVar(). I want my button in the 'main_frame' method to call 'result_frame' and use the value located in my first window. If I add a parameter to the second method then I'd have to specify it in my button right away and that will of course immediately call it when the program is opened which I want to avoid. I apologize if this is an easy solution I'm just missing here, I've struggled with this for a while with no solution. I was told last time I posted this to only call one instance of Tk() which I have done here and used Toplevel() for my additional window but I'm still having issues passing the variable from one window to the other.</p>