Video:
Sintaxis del programa:
import thread #Para el manejos de hilos
import time
def imprimir_mensaje(mensaje):
while True:
print(mensaje)
time.sleep(1)
def main():
mensaje="Thread " #variable aux
#Empiezo del thread
mensaje2=" Thread2"
thread.start_new_thread(imprimir_mensaje, (mensaje,))
thread.start_new_thread(imprimir_mensaje, (mensaje2,))
x = raw_input("Estoy esperando a que presiones enter...\n")
print ("Termino la funcion main")
main()

No hay comentarios.:
Publicar un comentario