System: Windows 10 64 bits and Jupyter Notebook with Python 3.9.12.
I have a .py file with the following codes:
from time import sleep
def task():
print('Hello from child process')
sleep(1)
and an .ipynb:
from tasks import task
import torch.multiprocessing as mp
if __name__ == '__main__':
print('Hello from main process')
process = mp.Process(target=task)
process.start()
process.join()
print('Hello again from main process')
While jupyter notebook printed the following 2 lines,
Hello from main process
Hello again from main process
Anaconda prompt (the black screen) return
Hello from child process
Is it possible to move the 'Hello from child process' line to the jupyter notebook?
That is
Hello from main process
Hello from child process
Hello again from main process