Answer the question
In order to leave comments, you need to log in
How not to wait for a function call to finish in Python?
So I have a function like this:
import time
def f(a):
if(a>1):
time.sleep(3600)
f()
#код выполняется дальше
Answer the question
In order to leave comments, you need to log in
https://docs.python.org/3/library/threading.html
Just keep in mind that python has a global lock, and such parallelization will be very conditional.
In general, it all depends on the task. If you are writing something network, then it is better to take tornado / asyncio or celery
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question