Código Python:
pero me devuelve este error:Ver original
from time from threading import Thread def myfunc(i): print "sleeping 5 sec from thread %d" % i time.sleep(5) print "finished sleeping from thread %d" % i for i in range(10): t = Thread(target=myfunc, args=(i,)) t.start()
Código:
Creo que me falta la libreria, como ago para instalarla?? he provado pip pero no lo consigo...Traceback (most recent call last): File "./time.py", line 16, in <module> import time from threading import Thread File "/usr/lib64/python2.7/threading.py", line 13, in <module> from time import time as _time, sleep as _sleep ImportError: cannot import name sleep
Gracias!!