response = urllib2.urlopen("http://example.com/Hi")
html = response.read()
Is it possible that when the above code is run while the Hi directory has been removed (or the server is not available), instead of crashing, an action like below is done?
if html==404:
print("No response")