title: What are the alternatives to Globals in Python using Tkinter
body: <p>I am teaching a class and have been told to avoid global statements using Python and Tkinter. I don't want to teach Classes to my students yet</p>
  
  <p>I know I can create all my entry boxes and labels out of a subroutine and my code will work, but this is just teaching a different bad practice</p>
  
  <pre><code>from tkinter import *
  
  def print_name():
      print(entry_location.get())
  
  def main():
      global main_window,entry_location
      main_window =Tk()
      Button(main_window, text="Print Name",command=print_name) .pack()
      entry_location = Entry(main_window)
      entry_location.pack()
      main_window.mainloop()
  
  main()
  </code></pre>
  
  <p>This works with the global statement, but short of removing the code in main() from the subroutine is there an alternative?</p>