#Sometimes, it is necessary to execute a task in the background. A special type of thread is used for background tasks, called a daemon thread. In other words, daemon threads execute tasks in the background.
import time
import threading
def timer():
count=0
while True:
time.sleep(1)
count+=1
print("Logged in ",count,"count")
x=threading.Thread(target=timer,daemon=True)
x.start()
a=input("Would you like to log out and exit?:")
print("Shutting down...")
En esta página del sitio puede ver el video en línea DEAMON THREADS IN PYTHON|CODEJAL| de Duración hora minuto segunda en buena calidad , que subió el usuario codejal 25 abril 2024, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 4 veces y le gustó 0 a los espectadores. Disfruta viendo!