Advertisement
Guest User

web spyder

a guest
Jan 17th, 2014
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. from multiprocessing import Pool
  2. import urllib, time, os
  3. def esplora(url):
  4.     print("Sto leggendo {0} (proc:{1})".format(url, os.getpid()))
  5.     urllib.urlretrieve("http://{0}".format(url), url)
  6. if __name__ == '__main__':
  7.     p = Pool(3)
  8.     p.map(esplora, ["www.ubuntu.com", "www.linux.org", "www.python.org"]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement