Archivo de Python:
Ejecución del programa:
Código:
"Generar Thread"
import threading
import time
stop = 0
def hola_mundo(nombre):
play=1
while play < 11:
print ("Hola Mundo" + nombre)
play=(play+1)
time.sleep(1) #tiempo que duerme el programa
if __name__ == "__main__":
hilos = threading.Thread(target =hola_mundo, args = (" Ivan ",) )
hilos.start()
print 'ultima instruccion del main'
No hay comentarios:
Publicar un comentario