I tried the following to create two worker processes
The problem is that printf prints me 1 two times instead of 0 and 1
Why? What can I do to start the first worker with id 0 and another with id 1?
1 2 3 4 5 6 |
import threading for i in range ( 0 , 2 ): def spawnAWorker(): printf( "%s" , i) #os.system('start cmd /K ' + workerCmd) threading.Thread(target = lambda : spawnAWorker()).start() |
