I am trying to learn python. This a script I wrote to check internet connection
import os
import urllib2
from time import sleep
REMOTE_SERVER = \"www.google.co.u
Basically, never do this:
try:
something()
except:
pass
Which is the Python equivalent of the good'ol Visual Basic anti-pattern, if you recall:
On Error Resume Next
Leading to unmaintainable and impossible to debug code. Simply because when a problem arises, you don't know what happened (and you don't even know that there is any problem at all).
In your particular case, I suggest you remove the try/except block so that you can know which exception is raised in the traceback. Then, you'll be able to fix it.