title: Problems with 'method' object is not subscriptable
body: <p>I have a textfile which contains </p>
  
  <blockquote>
    <p>id_is_g0000515</p>
    
    <p>num_is_0.92</p>
    
    <p>id_is_g0000774</p>
    
    <p>num_is_1.04</p>
    
    <p>id_is_g0000377</p>
    
    <p>num_is_1.01</p>
    
    <p>id_is_g0000521</p>
    
    <p>num_is_5.6</p>
  </blockquote>
  
  <p>Its suppose to sort the data in by "g0000515" and by numbers only "0.92" without the string "id_is_" and "num_is_". It gives me an error TypeError: 'method' object is not subscriptable. Can someone help me? </p>
  
  <pre><code>    import os, sys, shutil, re
  
  
  def readFile():
      from queue import PriorityQueue
      q = PriorityQueue()
      #try block will execute if the text file is found
      try:
          fileName= open("Real_format.txt",'r')
          #for tuple in fileName:
              #fileName.write('%s',tuple)
          for line in fileName:
                  for string in line.strip().split(','):
                      if string.find("id_is_"):
                          q.put[-4:] #read the ID only as g0000774
                      elif string.find("num_is_"):
                          q.put[-4:] #read the num only as 0.92
  
          fileName.close() #close the file after reading          
          print("Displaying Sorted Data")
          #print("ID TYPE       Type")
          while not q.empty():
              print(string[30:35] + ":     " +q.get())
              #print(q.get())
  
              #catch block will execute if no text file is found
      except IOError:
                  print("Error: FileNotFoundException")
                  return
  
  readFile() 
  </code></pre>