Fatal Python error: PyImport_GetModuleDict: no module dictionary Fatal Python error: PyImport_GetModuleDict: no module dictionary multithreading multithreading

Fatal Python error: PyImport_GetModuleDict: no module dictionary


The problem is that when you run this as a stand alone script you have a lot of daemon threads in doWork, but the script will exit when only daemon threads are left, so they all get killed by the interpreter exiting. When you run it interactively in IDLE the interpreter doesn't exit, so you don't run into that problem.