Skip to content

Commit

Permalink
bpo-46079: Replace external link that is down for maintenance. (GH-30315
Browse files Browse the repository at this point in the history
  • Loading branch information
miss-islington committed Jan 1, 2022
1 parent 2d4049d commit 72ffcb0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Doc/tutorial/stdlib.rst
Expand Up @@ -178,13 +178,13 @@ protocols. Two of the simplest are :mod:`urllib.request` for retrieving data
from URLs and :mod:`smtplib` for sending mail::

>>> from urllib.request import urlopen
>>> with urlopen('http://tycho.usno.navy.mil/cgi-bin/timer.pl') as response:
>>> with urlopen('http://worldtimeapi.org/api/timezone/etc/UTC.txt') as response:
... for line in response:
... 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)

<BR>Nov. 25, 09:43:32 PM EST
... line = line.decode() # Convert bytes to a str
... if line.startswith('datetime'):
... print(line.rstrip()) # Remove trailing newline
...
datetime: 2022-01-01T01:36:47.689215+00:00

>>> import smtplib
>>> server = smtplib.SMTP('localhost')
Expand Down

0 comments on commit 72ffcb0

Please sign in to comment.