You can set the thread as a global variable and only start it in the function, as following:
import time
import threading
def wait():
time.sleep(5)
login_thread = threading.Thread(target=wait)
def start_inline_paid_generator():
login_thread.start()
print(login_thread.is_alive()) # False
start_inline_paid_generator()
print(login_thread.is_alive()) # True
Then you can check anywhere in your program with login_thread.is_alive()
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…