title: can't set attribute in class instance in Python
body: <p>I'm trying to create a instance of a class to test that the module I created is working properly. </p>
  
  <p>Here is the module (fileWriter.py), the error appears to be in the <strong>init</strong> method:</p>
  
  <pre><code>class File(object):
  '''process the data from a file'''
  
  #fields
  #fileName = name of file
  #textData = data read from/written to file
  
  #Constructor
  def __init__(self, fileName = 'saved_data.txt', textData = ''):
      #Attributes
      self.fileName = fileName
      self.textData = textData
  
  #Properties
  @property #getter
  def fileName(self):
      return self.__fileName
  
  @fileName.setter #setter
  def fileName(self, value):
      self.__fileName = value
  
  @property #getter
  def textData(self, value):
      self.__textData = value
  
  #Methods
  def saveData(self):
      '''appends data to file'''
      try:
          fileObj = open(self.fileName, 'a')
          fileObj.write(self.textData)
          fileObj.close()
      except Exception as e:
          print('You have the following error: ' + str(e))
      return('Data successfully saved to file.')
  
  def toString(self):
      '''returns text data explicitly'''
      return self.fileName + ':' + self.textData
  
  def __str__(self):
      '''returns text data implicitly'''
      return self.toString()
  </code></pre>
  
  <p>To test the class, I wrote the following test harness:</p>
  
  <pre><code>    import fileWriter
  
      import fileWriter
  
  #test harness
  processorObj = fileWriter.File()
  processorObj.fileName = 'test.txt'
  processorObj.textData = 'testing, 1, 2, 3...'
  strMessage = processorObj.saveData()
  print(strMessage)
  
  if __name__ == '__main__':
      raise Exception('Don\'t run a module by itself!')
  </code></pre>
  
  <p>When I run the test file, I get the error:</p>
  
  <p>File "testFileWriter.py", line 4, in 
      processorObj = fileWriter.File()
    File "/Users/Haruka/Documents/python_class/Employees/fileWriter.py", line 19, in <strong>init</strong>
      self.textData = textData
  AttributeError: can't set attribute</p>
  
  <p>I can't figure out what's wrong with self.textData = textData. Can anybody help?</p>