I have defined several functions.
def func1():
'''something goes here'''
def func2():
'''something goes here'''
def func3():
'''something goes here'''
def func4():
'''something goes here'''
So the question is: I want to run func1()
always and other function(func2()
, func3()
, func4()
) should be available if we call the function while func1()
running. I don't want func2()
, func3()
, func4()
run unless call by user. How this can be done?.
Here is what I've done so far
if __name__ == '__main__':
Thread(target=func1()).start()
Here I started the function func1()
. Mean while the function func1()
running if user call the other functions it should run otherwise not
I've referred some threading and multi processing but still not able to get the answer. Is it possible? If so please guide me in a correct way.
Thanks in advance