(Feb-02-2022, 01:10 PM)deanhystad Wrote: This should work on linux, but it will not work on windows. In linux a process is forked, starting out with the same process image as the parent. In windows a process is spawned, starting out as a completely new process.
To have global variables in windows (and you should do this for linux too) you need to use the multiprocessor manager to create mutable objects that are shared among processes. When you spawn a process you pass the shared object as an argument.
import multiprocessing ... manager = multiprocessing.Manager() hotel = manager.list() ... process = multiprocessing.Process(target=whatever, args=[hotel]) ...
Thank you!
...wait, there are differences between linux and windows?
Well, I'll try it on my linux laptop. Thanks!
Would there be any way to do this on windows?