Roshan Book

My Tech Notebook

Python tutorial 17.2 Working with modules


Opening and encoding a webpage

def main():
    import urllib.request
    page=urllib.request.urlopen(‘http://bw.org/’)
    for line in page: print(str(line, encoding =’utf_8′), end=”)

if __name__ == “__main__”: main()

 

 

Module resource : http://docs.python.org/py3k/index.html

4 responses to “Python tutorial 17.2 Working with modules

  1. Dennis Tuzzolo October 24, 2011 at 1:04 am

    Come check out the biggest new dating site and find your partner instantly free!. Sign up now for free gold account status $25 value for free with no strings attached!. http://dating1.todaysdatingscene.info/

  2. Discount Ugg Boots November 18, 2011 at 6:24 am

    Hello my loved one! I wish to say that this post is amazing, great written and come with almost all significant infos. I’d like to look more posts like this .

  3. Designer Handbags December 1, 2011 at 3:12 pm

    I identified this internet site via aol and I’m actually glad about the facts you provide in your blog. Btw your sites really broken using firefox4

  4. Designer Handbags December 5, 2011 at 5:04 am

    This is a unique and wonderful post. It is to the point, it touches all the right bases, and is well written on top of all that.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: