File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -183,13 +183,13 @@ protocols. Two of the simplest are :mod:`urllib.request` for retrieving data
183183from URLs and :mod: `smtplib ` for sending mail::
184184
185185 >>> from urllib.request import urlopen
186- >>> with urlopen('http ://worldtimeapi. org/api/timezone/etc/UTC.txt ') as response:
186+ >>> with urlopen('https ://docs.python. org/3/ ') as response:
187187 ... for line in response:
188188 ... line = line.decode() # Convert bytes to a str
189- ... if line.startswith('datetime') :
189+ ... if 'updated' in line :
190190 ... print(line.rstrip()) # Remove trailing newline
191191 ...
192- datetime: 2022-01-01T01:36:47.689215+00:00
192+ Last updated on Nov 11, 2025 (20:11 UTC).
193193
194194 >>> import smtplib
195195 >>> server = smtplib.SMTP('localhost')
You can’t perform that action at this time.
0 commit comments