Created
April 11, 2015 15:06
-
-
Save Averroes/c74990b24664d3c0337d to your computer and use it in GitHub Desktop.
urllib2 urlopen iterator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# encoding: utf-8 | |
# | |
# Copyright (c) 2008 Doug Hellmann All rights reserved. | |
# | |
"""Simple example with urllib.urlopen(). | |
""" | |
#end_pymotw_header | |
import urllib2 | |
response = urllib2.urlopen('http://localhost:8080/') | |
for line in response: | |
print line.rstrip() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment