The following code seems to be executed sequentially rather than concurrently. And it only made use of one CPU core. Is there a way to make it use multiple cores or switch content between threads? (I hope it could work like Thread class in java.)
import threading
def work(s) :
for i in range(100) :
print s
for j in range (12345678) :
pass
a = []
for i in range(3) :
thd = threading.Thread(target = work('#'+str(i)))
a.append(thd)
for k in a : k.start()
for k in a : k.join()
print "Ended."