Ver Mensaje Individual
  #2 (permalink)  
Antiguo 03/04/2013, 07:01
sukoy
 
Fecha de Ingreso: febrero-2011
Mensajes: 54
Antigüedad: 13 años, 2 meses
Puntos: 18
Respuesta: Problema libreria time, trheading

Es esto:

Código Python:
Ver original
  1. import time
  2. from threading import Thread
  3.  
  4. def myfunc(i):
  5.     print "sleeping 5 sec from thread %d" % i
  6.     time.sleep(5)
  7.     print "finished sleeping from thread %d" % i
  8.    
  9. for i in range(10):
  10.     t = Thread(target = myfunc(i))
  11.     t.start()