ID EN
Concurrent Futures

submit

Python 3.11

Schedules the callable, fn, to be executed as fn(*args, **kwargs) and returns a Future object representing the execution of the callable.

Syntax

PYTHON
submit(fn, /, *args, **kwargs)

Examples

Example 1
PYTHON
with ThreadPoolExecutor(max_workers=1) as executor:
    future = executor.submit(pow, 323, 1235)
    print(future.result())

See Also

Future