📜  python 线程返回值 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:25.933000             🧑  作者: Mango

代码示例2
import concurrent.futures

def foo(bar):
    print('hello {}'.format(bar))
    return 'foo'

with concurrent.futures.ThreadPoolExecutor() as executor:
    future = executor.submit(foo, 'world!')
    return_value = future.result()
    print(return_value)