title: Calling variable from class in seperate python module (tk.Frames)
body: <p>I'm writing a <code>tkinter</code> app that has 3 pages in three different <code>.py</code> files. </p>
  
  <p>I've reworked the code to allow me to create each frame by running a main overarching app which is <code>self.controller</code> in all the subsequent pages (thanks to some excellent users on this site). The reason I have done this is that I want to be able to pass a user name (<code>tk.StringVar()</code>) from the first Frame to a <code>tk.Label</code> in the second Frame. </p>
  
  <p>As I've said above I've rewritten this code a few times but still when I try to actually call a variable or a function from either of the other pages I get the error shown below. </p>
  
  <p>The other page is called FrontPage and it's stored in <code>front_page.py</code> and when I run that page through the main <code>tk.Tk</code> it works perfectly so I know I have definied <code>self.name_entry</code> properly there. </p>
  
  <p>The (minimum) code I'm using for the <code>GamePage</code> is</p>
  
  <pre><code>import tkinter as tk
  from tkinter import SUNKEN
  import front_page
  from front_page import FrontPage
  from character import Character
  from dice_roll import Die
  
  
  class GamePage(tk.Frame):
      """The overall class for the app"""
  
      def __init__(self, parent, controller):
          tk.Frame.__init__(self, parent)
          self.controller = controller
          label = tk.Label(self, text="This is the start page")
          label.pack(side="top", fill="x", pady=10)
          self.features = {}
  
          #This is where I try to call the text from the other page
          self.character_name = front_page.FrontPage.name_entry.get()
  
          self.name_label = tk.Label(
              self.mainframe,
              text= self.character_name,
              font=("Courier", 20),
              bd = 1,
              relief = SUNKEN
          )
          self.name_label.pack()
  </code></pre>
  
  <p>When I try to actually call a the text from a <code>tk.Entry</code> on the FrontPage it doesn't work. All the functions from my other classes (which are imported up top) work fine. </p>
  
  <pre><code>Traceback (most recent call last):
    File "/Users/kevinomalley/Desktop/python_work/rapid_rpg/app_GUI.py",       
  line 47, in &lt;module&gt;
      app = GUI()
    File "/Users/kevinomalley/Desktop/python_work/rapid_rpg/app_GUI.py", 
  line 20, in __init__
      frame = F(parent=container, controller=self)
    File "/Users/kevinomalley/Desktop/python_work/rapid_rpg/main_page.py", 
  line 23, in __init__
      self.character_name = front_page.FrontPage.name_entry.get()
  AttributeError: type object 'FrontPage' has no attribute 'name_entry'
  </code></pre>
  
  <p>Now I'm 90% sure this is because I'm not using the <code>self.controller</code> properly
  I've seen loads of answers referencing it but no clear explanation about how to use it or effectively call it. </p>
  
  <p>If anyone could free me from 5 days of beating my head against a wall it'd lift my poor little newbie heart. </p>
  
  <p>Thanks</p>