DEAMON THREADS IN PYTHON|CODEJAL|

Publicado em: 25 Abril 2024
no canal de: codejal
4
0

#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...")


Nesta página do site você pode assistir ao vídeo on-line DEAMON THREADS IN PYTHON|CODEJAL| duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário codejal 25 Abril 2024, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 4 vezes e gostou 0 espectadores. Boa visualização!