Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- urllib2.urlopen("http://example.com/check.txt").read()
- import urllib2
- file = urllib2.urlopen("http://example.com/check.txt")
- try:
- file.read()
- except urllib2.URLError:
- print "File Not Found"
- else:
- print "File is found"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement