0

Hi, i need to use threading, but i don't know how to gets a value returned by my function i would really appreciate your help

thread = threading.Thread(target=chess_engine.engine, args=(my_arguments))
thread.start()
thread.join()
temp = "value returned by chess_engine.engine"
  • 1
    You can't return a value from a thread. You might want to look into `concurrent.futures`, which wraps running a task (with a function, args and a return value) in a secondary thread for you. – AKX Apr 09 '21 at 11:17
  • this is a duplicated question: https://stackoverflow.com/questions/6893968/how-to-get-the-return-value-from-a-thread-in-python – Martí Apr 09 '21 at 11:21

0 Answers0