您在這裡

Exercises

8 九月, 2015 - 10:43

Exercise 14.6.Theurllibmodule provides methods for manipulating URLs and downloading information from the web. The following example downloads and prints a secret message fromthinkpython.com:

import urllib
 
conn = urllib.urlopen('http://thinkpython.com/secret.html')
for line in conn:
print line.strip()

Run this code and follow the instructions you see there. Solution: http: // thinkpython. com/code/ zip_ code. py.