Jump to content


Chapter 2 - Test Drive Page 47

  • Please log in to reply
1 reply to this topic

#1 KiwiSue


    New Member

  • Members
  • Pip
  • 1 posts

Posted 25 March 2011 - 07:29 PM

Hi there,

In the fifth week of a Diploma in Computer Servicing here in Wellington, New Zealand. We are up to chapter 2 of the 2009 version of the Head First Programming book. Have finished downloading from download.cnet.com the 3.1 version of Python (the 2.7 did not recognise the 'import urllib.request' line)

Was wondering, does anyone know what("utf8") represented (line 3 of the code on page 47)

Also, while I'm at it - is there a link available to one place that has an easy to understand glossary of terms, such as for the words like variable, array. Got left behind after the third month of maths at College back in the 80's. Yes, I am old - well compared to a 17 year old. But not a 60 year old.

Anyway, any help would be most appreciated.

Thanks ahead of time.


#2 paulbarry


    Advanced Member

  • O'Reilly Author
  • PipPipPipPipPipPipPipPip
  • 307 posts

Posted 26 March 2011 - 01:58 AM

Hi Sue.

Note that this is the forum for Head First Python. The programming book has its own forum here:


However, to quickly answer your question re: 'utf8' - this has to do with the how characters are stored (or encoded) on the disk in the computer. 'utf8' is a type of encoding from the Unicode standard... and it's used by lots of technologies (including Python). All we are doing on that line is confirming that we want to use that encoding when we retrieve the data over the web.

Note that both the HF Programming and HF Python books (initially) assume the use of Python 3. There is no guarantee that the code in the books will work with Python 2.

Re: a glossary of terms. My advice would be to do a search on wikipedia for the term you are interested in. (That's what I always do). Maybe try that now with 'utf8'?

Have fun!


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users