Dear Pythoners,<div>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).</div><div>Inputting the username and password for authentication and final display of the results is done by GUI.</div>
<div>I was able to isolate that major chunk of run time is eaten up in opening a webpages, reading from them and extracting text.</div><div>I wanted to know if there is a way to concurrently calling the functions.</div><div>
<br></div><div>here is my pseudo code:</div><div><br></div><div>database=[]</div><div>in a while loop:</div><div>   build the url by concatenating the query parametres</div><div>   temp=urlopen(url).read()</div><div>   dict['Key1']=get_key1_data(temp) ## passing the entire string obtained by .read()</div>
<div>   dict['key2']=get_key2_data(temp)</div><div>   .</div><div>   .</div><div>   .</div><div>   dict['keyn']=get_keyn_data(temp)</div><div>   database=database+[dict]   ## building an array of dictionaries</div>
<div><br></div><div>My question here is can I have the functions get_key1_data to get_keyn_data run in some concurrent way.??</div><div>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</div>
<div><br></div><div>Appreciating your help in this one.</div><div><br></div><div>Warm Regards,</div><div>Abhijeet.</div>