Skip to content

Instantly share code, notes, and snippets.

@Averroes
Created April 11, 2015 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Averroes/c74990b24664d3c0337d to your computer and use it in GitHub Desktop.
Save Averroes/c74990b24664d3c0337d to your computer and use it in GitHub Desktop.
urllib2 urlopen iterator
#!/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