title: TypeError: 'str' object is not callable. Even though there is nothing called 'str'
body: <p>Before I start there are many other exact questions but none of the answers are adequate to my problem. The class/function <code>log.info('foo')</code> runs once with no problem however the second time it's called it get the error <code>TypeError: 'str' object is not callable</code></p>
  
  <p>I found that <a href="https://stackoverflow.com/questions/6039605/typeerror-str-object-is-not-callable-python">this question</a> has the same problem as me, however I don't have anything called str. I have tested with with other funcions i.e war.</p>
  
  <p>My code:</p>
  
  <pre><code>import praw
  import sys
  import traceback
  from accounts import *
  
  class logging:
  
      def info(self, log):
          self.info = '\033[94m'
          self.rs = '\033[0m'
          print self.info, 'INFO: ', self.rs
  
      def warn(self, log):
          self.warn = '\033[93m'
          self.rs = '\033[0m'
          print self.warn, 'WARNING: ', self.log, self.rs
  
      def critical(self, log):
          self.critical = '\033[91m'
          self.rs = '\033[0m'
          print self.critical, 'CRITICAL: ', log, self.rs
  
  def read_accounts():
      with open('accounts.py') as f:
          for i, l in enumerate(f):
              pass
  
      i += 1
      accounts = {}
  
      while i &gt; 0:
          ac = globals()['account_%s' %i]
          index = ac.find(':')
          uname = ac[0:index]
          password = ac[index+1:len(ac)]
          accounts[uname] = password
          i -= 1
  
      log.info('Usernames loaded successfully! Usernames loaded:')
      print  accounts
  
  def main():
      log.info('Initilizing reddit accounts from file...')
      try:
          read_accounts()
      except:
          traceback.print_exc()
          log.critical('Can not read accounts! Make sure format is correct!')
          sys.exit()
  
  
  if __name__ == '__main__':
      log = logging()
      main()
  </code></pre>
  
  <p>Also I know there is a logging module in python but I wanted to do my own thing!</p>
  
  <p>Thanks in advance!</p>