On Windows, all of your multiprocessing -using code must be protected if __name__ == "__main__":
So, to be safe, I would put all your code at the top level of your script in the main() function, and then just do it at the top level:
if __name__ == "__main__": main()
See the “Secure Import of the Main Module” section here for an explanation of why this is necessary. You probably do not need to call freeze_support at freeze_support , although that doesn’t prevent it from being turned on.
Please note that in any case, it is recommended that you use if __name__ == "__main__" guard for scripts, so the code will not be executed unexpectedly if you find that you need to import your script into another script at some point in the future.
dano
source share