2

I'm trying to get this code to work, and it looks like update isn't getting called. Nothing is printed to the console with this code, why?

from multiprocessing import Process

def update():
    print("hi")

if __name__ == '__main__':
    p = Process(target=update, args=())
    p.start()
    p.join()
yellowedhare
  • 77
  • 2
  • 6

2 Answers2

3

Run your program from the command line, python idle doesn't deal with this correctly as detailed here

Community
  • 1
  • 1
pointerless
  • 753
  • 9
  • 20
0

Sorry for the stupid answer, but maybe you do not have time to see the output in stdout? Try running the script from the command line, like this: c:\<script location>\script.py

UPD: riscnotcisc said true.

ErvingGoffman
  • 189
  • 1
  • 3
  • 17