I want only one Thread to be active, here is the algorithm:
def myfunction(update):
if threading.activeCount >=1:
# kill all previous threads
while true:
# some execution
while true:
t = threading.Thread(myfunction, args=([update]))
t.start()
so In here thread goes in Infinite loop in myfunction, so before starting new one i need to close previous one, please guide me