python inheritence call new url after overriding
Question: In the following code even after overiding the init function it still calls
the old url,i want the new url contents instead how to do this

    
    
      import urllib
      import json
    
    
      class process():
         def processdata(self):
            for di in results:
    
               super(processcontent,self).__init__(new_url)
               new_obj  = getcontent.getdata()
               print new_obj
               break
    
    
    
      if __name__ == '__main__':
         url = "someurl"
         p = processcontent(url)
         #print p.getdata()
         p.processdata()
    


Answer: First, you should not call `__init__` after initialization, second, you don't
use the attribute `self.url` but the global variable `url`. Since `url` isn't
a real attribute, you should call `getdata` with a parameter `url`:

    
    
      import urllib
      import json
    
    
    
      class processcontent(Basecontent,getcontent):
         def processdata(self):
            obj = self.getdata(self.url)
            results = obj["response"]
            for di in results:
               new_url =  di["clusterUrl"]
               new_obj  = self.getdata(new_url)
               print new_obj
               break
    
      def main():
         url = "someurl"
         p = processcontent(url)
         #print p.getdata()
         p.processdata()
    
    
      if __name__ == '__main__':
          main()
    

