mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Merged revisions 78325 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r78325 | senthil.kumaran | 2010-02-22 22:47:22 +0530 (Mon, 22 Feb 2010) | 2 lines Fixing Issue7399 - Fixing an example of urllib usage. ........
This commit is contained in:
parent
3fda93e930
commit
3b63c3d059
1 changed files with 1 additions and 0 deletions
|
@ -152,6 +152,7 @@ from urls and :mod:`smtplib` for sending mail::
|
|||
|
||||
>>> 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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue