title: "Master" not defined within class instance
body: <p>Im trying to pass an instance of an class to which i can retrieve a function, however i keep on recieving "master" not defined when i run the program. What am i doing wrong?</p>
  
  <pre><code>class MainPageGUI:
      def __init__(self, master):
  
          self.master = master
          self.master.title("Jans Corp")
          self.master.configure(background='lightgrey')
          self.master.geometry("1200x800")
  
          self.DisplayData()
  
      def DisplayData(self):
          self.ReturnedData = Database(master) # &lt;----------- I am recieving error here
          self.ReturnedData = getattr(self.ReturnedData, 'ReadData')
          for index, data in enumerate(self.ReturnedData):
              tk.Label(self.master, text = data[0]).grid(row = index+1, column = 0)
              tk.Label(self.master, text = data[1]).grid(row = index+1, column = 1)
              tk.Label(self.master, text = data[2]).grid(row = index+1, column = 2)
              tk.Label(self.master, text = data[3]).grid(row = index+1, column = 3)
              tk.Label(self.master, text = data[4]).grid(row = index+1, column = 4)
              tk.Label(self.master, text = data[5]).grid(row = index+1, column = 5)
              tk.Label(self.master, text = data[6]).grid(row = index+1, column = 6)
  </code></pre>
  
  <p>Here is where im using calling the function from </p>
  
  <pre><code>class Database:
      def __init__(self, master):
  
          conn = sqlite3.connect(':memory:')
          c = conn.cursor()
  
          c.execute("""CREATE TABLE Employees (
                          FirstName text,
                          Surname text,
                          Age Integer,
                          Postcode VARCHAR,
                          Wage Integer,
                          Email VARCHAR,
                          Hours Integer
                          )""")
  
          conn.commit()
          conn.close()
  
          EmployeeInfo = MainPageGUI(master) &lt;----------- Here i added master
          db = Database()
          db.addEmployee(EmployeeInfo)
  
  
      def ReadData(self):
          c.execute("SELECT * FROM Employees")
          return c.fetchall()
  
      def addEmployees(self , EmployeeInfo): #replace emp with the employees the users add from the entry function
          with conn:
              c.execute("INSERT INTO Employees VALUES (:FirstName, :Surname, :Age, :Postcode, :Wage, :Email, :Hours)",
                        {'FirstName':EmployeeInfo.FirstNameEntry.get(), 'Surname':EmployeeInfo.SurnameEntry.get(), 'Age':EmployeeInfo.AgeEntry.get(),
                        'postcode':EmployeeInfo.PostcodeEntry.get(), 'Wage':EmployeeInfo.EmailEntry.get(), 'Email':EmployeeInfo.EmailEntry.get(), 'Hours':EmployeeInfo.HoursEntry.get()})
          conn.commit()
  </code></pre>