Tips on Speeding up Python Execution

Abhijeet Mahagaonkar abhijeet.manohar at
Fri Apr 8 03:04:34 EDT 2011

Dear Pythoners,
I have written a python application which authenticates a user, reads a
webpage and searches for pattern and builds a database ( In my case its a
dictinary with fixed set of keys).
Inputting the username and password for authentication and final display of
the results is done by GUI.
I was able to isolate that major chunk of run time is eaten up in opening a
webpages, reading from them and extracting text.
I wanted to know if there is a way to concurrently calling the functions.

here is my pseudo code:

in a while loop:
   build the url by concatenating the query parametres
   dict['Key1']=get_key1_data(temp) ## passing the entire string obtained by
   database=database+[dict]   ## building an array of dictionaries

My question here is can I have the functions get_key1_data to get_keyn_data
run in some concurrent way.??
I ask this because these functions are not dependent on one another. They
all have access to the same parsed url and independently pull data in order
to populate the final database

Appreciating your help in this one.

Warm Regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list