I'm new to multithreading using Python 2.7.6. I need to get the values returned by my threads after starting them.
My code is as follow :
from threading import Thread
from functions import *
class Client(Thread):
def __init__(self, index,ip,t,i=1):
Thread.__init__(self)
self.ip_dst = ip
self.t = t
def run(self):
value_back = execute(self.ip_dst,self.t,i=1)
return value_back
The execute_client function is executed by every Thread. I want to get the value_back for each thread at the end and store them let's say in a list data structure. The execute function is inside the functions module I wrote.
I looked at this related issue but did not understand how to adapt the answer for my code.