Reputation: 217
If I have these two fuctions:
def func1():
print "I am function1"
def func2():
print "Function 1 is still running."
while(func1 is running):
func2()
How do I check if function 1 is still running?
Upvotes: 1
Views: 8873
Reputation: 217
I solved this using the threading module. Below is my code.
import threading
from threading import Thread
func1_thread = Thread(target = func1)
while func1_thread.isAlive():
func2()
Upvotes: 2