I searched some examples in the official python page, others pages and also books, but processes doesn't work. In this example I only print a message that is passed as a parameter to each function. I don't know why, but processes don't work in Windows because I tried in 3 different computers(2 with Windows and other with Linux) and a web page to program with Python and process don't work in Windows
from multiprocessing import Process
from time import sleep
def worker(msg):
for i in range(0, 10):
print(msg, end='', flush=True) # <----- print msg
print('Starting')
t2 = Process(target=worker, args=('A',))
t3 = Process(target=worker, args=('B',))
t4 = Process(target=worker, args=('C',))
t2.start() # <---------------------------
t3.start() # <----- they don't work -----
t4.start() # <---------------------------
t2.join()
t3.join()
t4.join()
print('Done')
This is printed as output:
Starting
Done