title: cant read all documents intances via class while creating a python dict ,read only one
body: <p>am creating a dict from two documents, I need to call the function computePayment independently from the two objects, but it computes one object only. I cant get details from hours.text
  I only want to work with classes.</p>
  <pre><code> class Document:
      def __init__(self,file):
          self.file=file
          with open(self.file ,'r') as f:
              self.data=f.read()
  
      def read(self):
          self.info=self.data.split()
          return self.info
  
      def display_employee (self):
          self.employee_info=self.info
          print(self.employee_info)
          return self.employee_info   
  
      def display_work(self):
          self.work_info=self.info
          print(self.work_info)
          return self.work_info   
  
  
      def computePayment(self,**kwargs):
          if self.display_employee()[0]==self.display_work()[0]:          
  
              return dict(
                  name=self.display_employee()[1] + ' ' + self.display_employee()[2],
                  date=self.display_work()[1],
                  Regular_Hours_Worked=self.employee_info[3],
                  Overtime_Hours_Worked=1,
                  Regular_Rate=self.display_employee()[4],
                  Overtime_Rate=1,
                  Regular_Pay=1,
                  Overtime_Pay=1,
                  Gross_Pay=1,
                  Standard_Rate_Pay=1,
                  Higher_Rate_Pay=1,
                  Standard_Tax=1,
                  Higher_Tax=1,
                  Total_Tax=1,
                  Tax_Credit=self.display_employee()[6],
                  Net_Deductions=1,
                  Net_Pay=1,
                  )
  
  
          
          
  # CREATING EMPLOYEES OBJECTS 
  
  employee=Document(&quot;Employees.txt&quot;)
  employee.read()
  employee.display_employee()
  
  work=Document(&quot;Hours.txt&quot;)
  work.read()
  work.display_work()
  </code></pre>
  <p>if there an easier way, or how you cal calls a function without creating an object.
  thanks</p>