import urllib def checkURL(url): try: urllib.urlopen(url) except IOError: return 0 return 1 if __name__ == '__main__': assert checkURL('http://slashdot.org') assert not checkURL('http://foo') HTH. Alex.