[Python-checkins] r78325 - python/branches/py3k/Doc/tutorial/stdlib.rst

senthil.kumaran python-checkins at python.org
Mon Feb 22 18:17:22 CET 2010


Author: senthil.kumaran
Date: Mon Feb 22 18:17:22 2010
New Revision: 78325
Log:
Fixing Issue7399 - Fixing an example of urllib usage.
Modified:
 python/branches/py3k/Doc/tutorial/stdlib.rst
Modified: python/branches/py3k/Doc/tutorial/stdlib.rst
==============================================================================
--- python/branches/py3k/Doc/tutorial/stdlib.rst	(original)
+++ python/branches/py3k/Doc/tutorial/stdlib.rst	Mon Feb 22 18:17:22 2010
@@ -152,6 +152,7 @@
 
 >>> from urllib.request import urlopen
 >>> for line in urlopen('http://tycho.usno.navy.mil/cgi-bin/timer.pl'):
+ ... line = line.decode('utf-8') # Decoding the binary data to text.
 ... if 'EST' in line or 'EDT' in line: # look for Eastern Time
 ... print(line)
 


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /