Why does this fail?

Dave Murray dlmurray at micro-net.com
Sun Jan 4 19:58:17 EST 2004


New to Python question, why does this fail?

Thanks,
Dave

---testcase.py---
import sys, urllib, htmllib
def Checkit(URL):
    try:
        print "Opening", URL
        f = urllib.open(URL)
        f.close()
        return 1
    except:
        return 0

rtfp = Checkit("http://www.python.org/doc/Summary.html")
if rtfp == 1:
    print "OK"
else:
    print "Fail"


python testcase.py






More information about the Python-list mailing list