Код: Выделить всё
from function_helpers import func1
...
val1, val2 = None, None
...
thread1 = threading.Thread(func1, )
thread1.start()
while condition:
continue
else:
thread1.join()
#check the values of val1 and val2 after the thread had changed them
if val1!= None and val2!= None:
do_something()
Код: Выделить всё
...
def func1():
global val1, val2
val1, val2 = process_something_and_return_values()
если нет, то как сделать такую настройку для изменения значений переменных через поток
PS: использование Python 2.7
Подробнее здесь: https://stackoverflow.com/questions/790 ... ead-define