# Getting the open function from the url module
from urllib.request import urlopen

# Pick a url from which to get a file
myURL = "http://www.cs.ucdavis.edu/~amenta/w13/sparse.html"
# and get it using the open function
myData = urlopen(myURL)

# the file reading loop
for byteLine in myData:
    # a file from the Web is given as bytes, since
    # we are not sure what the right encoding should
    # be. 
    inStr = byteLine.decode() # decode in the simplest
    # possible way, each byte is a character
    print(inStr) # this gives us a string!
