+ 1
Is anybody here know, how can I make, if it's possible, concurrent computing in Python3? (anything like fork() in c++ )
Concurrent computing in Python
2 Answers
+ 2
Use threads. Here's a short example code:
-------------------------------------------
from threading import Thread
import time, random
def myThread(num):
time.sleep(random.random() * 4)
print(num)
return
for i in range(10):
t = Thread(target=myThread, args=(i+1,))
t.start()
0
thank you! it's that I want.
Sorry for my english, I'm from Russia