whats the smartest way to to Try again when I get socket time out exception
Try:
          opener=urllib.FancyURLopener(proxies)
          res=opener.open(req)
except Exception as details:
          self.writeLog(details)
lets for the above code I get a time out error from the socket, I wanna change the proxy and try again how do I do that (my function can not be done recursive) should I use something like while error is not socket time out keep doing this ? or should do a while True and in the except part change the proxy? 
whats the smartest way?
Write a separate function that handles the connect and if the connect fails this function throws an exception. Then in your main code you can use a try-catch and a while loop to try to connect multiple times.
python try if socket times out, try again