Try this sample. https://stackoverflow.com/questions/6893968/how-to-get-the-return-value-from-a-thread-in-python https://stackoverflow.com/questions/1886090/return-value-from-thread