mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Review the doc changes for the urllib package creation.
This commit is contained in:
parent
aca8fd7a9d
commit
0f7ede4569
9 changed files with 90 additions and 166 deletions
|
@ -150,8 +150,8 @@ There are a number of modules for accessing the internet and processing internet
|
|||
protocols. Two of the simplest are :mod:`urllib.request` for retrieving data
|
||||
from urls and :mod:`smtplib` for sending mail::
|
||||
|
||||
>>> import urllib.request
|
||||
>>> for line in urllib.request.urlopen('http://tycho.usno.navy.mil/cgi-bin/timer.pl'):
|
||||
>>> from urllib.request import urlopen
|
||||
>>> for line in urlopen('http://tycho.usno.navy.mil/cgi-bin/timer.pl'):
|
||||
... 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