Tips on Speeding up Python Execution
abhijeet.manohar at gmail.com
Fri Apr 8 09:04:34 CEST 2011
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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list