I am logging information in a tree view widget using ttk. From the information in each entry of the tree view, I am attempting to pass it to functions that use a selenium web driver to automate user actions. It is very important that the functions that access the webpage run concurrently.
def startTasks(click):
tasks = tv4.get_children() #the tasks logged in the treeview
for item in tasks:
taskInfo = tv4.item(item)
thread = Thread(target=masterFunction, args=(taskInfo,))
thread.start()
thread.join()
the master function is as follows
def masterFunction(task):
foo = {'site': task['text'], 'user': task['values'][0], 'pass': task['values'][1], 'size': str(task['values'][3])
, 'link': task['values'][2], 'proxy': task['values'][4]}
if (foo['site'] == 'site 1'):
site1(foo)
if (foo['site'] == 'site 2'):
site2(foo)
if (foo['site'] == 'site 3'):
site3(foo)
if (foo['site'] == 'site 4'):
site4(foo)
if (foo['site'] == 'site 5'):
site5(foo)
if (foo['site'] == 'site 6'):
site6(foo)
if (foo['site'] == 'site 7'):
site7(foo)
the functions that are called 'siteX' are simpily functions that use the selenium web driver to carry out processes. How do I fix the problem of only 1 driver running sequentially when I want them to run concurrently?