2 python questions!

G

Guest

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!
 
C

Christof Winter

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top