Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   2 python questions! (http://www.velocityreviews.com/forums/t535022-2-python-questions.html)

09-05-2007 09:14 AM

2 python questions!
 


Hi python community!
First question has to do with threading support. There is the
following simple case:
I have a dictionnary that gets it's values -which are url's-from a
function. Sort of

dictionnary['1'] = "http://www.google.com"
dictionnary['2'] = "http://www.python.com"
.....

I need to fill in the dictionnary with some url's. If I do it on
the simplest way, it would be like:

for i in range(20):
dictionnary["%s" % i] = get_urls(args)

and wait a long long time till it finishes. Can I do it easily with
threads, without having to add too much code? Ideal case would be
if all threads start simultaneously :)


Now the second question has to do with images retrieval and
manipulation. Which libraries do you propose to work with to
retrieve and resize images from the web?


Thanks in advance for any help!


--
Handyman Franchises. Click Here.
http://tagline.hushmail.com/fc/Ioyw6...b7fSaLiZQZqWk/


Christof Winter 09-05-2007 11:44 AM

Re: 2 python questions!
 
resist_think@hushmail.com wrote:
[...]

> Now the second question has to do with images retrieval and
> manipulation. Which libraries do you propose to work with to
> retrieve and resize images from the web?


urllib.urlretrieve() and
Python Imaging Library (PIL)


All times are GMT. The time now is 08:57 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.