Hello, everyone, recently I am trying to learn python's
multiprocessing, but
I got confused as a beginner.

If I run the code below:

from multiprocessing import Pool
import urllib2
otasks = [
     'http://www.php.net'
     'http://www.python.org'
     'http://www.perl.org'
     'http://www.gnu.org'
     ]

def f(url):
     return urllib2.urlopen(url).read()

pool = Pool(processes = 2)
print pool.map(f, tasks)


I'll receive this message:

Traceback (most recent call last):
   File "<stdin>", line 14, in <module>
   File "/usr/lib/python2.6/multiprocessing/pool.py", line 148, in map
     return self.map_async(func, iterable, chunksize).get()
   File "/usr/lib/python2.6/multiprocessing/pool.py", line 422, in get
     raise self._value
httplib.InvalidURL: nonnumeric port: ''



I run Python 2.6 on Ubuntu 10.10


Regards
Vincent


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to