+ 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

21st Mar 2017, 1:51 AM
learner
2 Antworten
+ 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()
21st Mar 2017, 2:48 AM
DaemonThread
DaemonThread - avatar
0
thank you! it's that I want. Sorry for my english, I'm from Russia
21st Mar 2017, 4:31 AM
learner