Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. urllib2.urlopen("http://example.com/check.txt").read()
  2.  
  3. import urllib2
  4.  
  5. file = urllib2.urlopen("http://example.com/check.txt")
  6.  
  7. try:
  8. file.read()
  9. except urllib2.URLError:
  10. print "File Not Found"
  11.  
  12. else:
  13. print "File is found"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement