from concurrent.futures import ThreadPoolExecutor
def func1():
return "result1"
def func2():
return "result2"
with ThreadPoolExecutor() as executor:
future1 = executor.submit(func1)
future2 = executor.submit(func2)
result1 = future1.result()
result2 = future2.result()
print(result1)
print(result2)
To embed this program on your website, copy the following code and paste it into your website's HTML: