Use the addheaders()
function on your opener
object.
Just add this one line after you create your opener, before you start opening pages:
opener.addheaders = [('User-agent', 'Mozilla/5.0')]
http://docs.python.org/library/urllib2.html (it's at the bottom of this document)