2

I am using the multiprocessing module for the first time in Python. But in the very first program, I got the printing error (output is blank basically). I am working in Jupyter Notebook (Python 3.7.6). Here I am attaching my code:

from multiprocessing import Process
def display(my_name):
    print ('Hi !!!' + " " + my_name)
if __name__ == '__main__':
    p = Process(target=display, args=('Python',))
    p.start()
    p.join()

Thanks for the help in advance.

  • Does this answer your question? [Jupyter notebook never finishes processing using multiprocessing (Python 3)](https://stackoverflow.com/questions/47313732/jupyter-notebook-never-finishes-processing-using-multiprocessing-python-3) – Booboo Mar 06 '21 at 14:07

1 Answers1

2

I believe you have been using the window which causes such a problem with Linux os you will not get such error.

Now, come to the solution to run such a program, create code in "file_name.py" format and run. output

for more detail you can read following blog :-> Python multiprocessing example not working

ritik raj
  • 21
  • 2
  • thanks for your help. It's working in colab and in anaconda as well. But I am facing that issue in my Jupyter notebook when I am running the cells. – S.Bhattacharya Mar 04 '21 at 10:45