Ver Mensaje Individual
  #4 (permalink)  
Antiguo 03/04/2013, 10:25
Victoria222
 
Fecha de Ingreso: marzo-2013
Mensajes: 19
Antigüedad: 11 años, 1 mes
Puntos: 0
Respuesta: Problema libreria time, trheading

Perdonar, he echo el copiar/pegar mal, ya lo tenia como me decias i me sale el mismo error. Disculpas.
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()

error:
ImportError: cannot import name sleep

Última edición por razpeitia; 03/04/2013 a las 10:47