Python Forum

Full Version: Making entry global in tkinter with multiprocessing
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hello guys, I need some help figuring out a bug in the code.

Basically, I am trying to figure out how to make an entry in tkinter a global variable scope with multiprocessing in the background. I have searched all through StackOverflow been trying to fix this for 2 days.

I have attached my code. Basically, I want that the date entered (start_date_confirmed/start_date) at the start of the program should be able to access in the nested functions(exactly in write_final_data()). But so far no luck.

Usually I get errors that start_date_confirmed not defined OR global variable error. I tried different combinations of declaring global variable and nonlocal variable. But no luck.

Any feedback will be useful. Attached link has the code.
https://www.codepile.net/pile/ox0XKQxg
https://stackoverflow.com/questions/6731...ssing-pool

Problem fixed. I used this method and it worked somehow. :) Thanks for reading and putting effortanyway
Are you using Windows? Windows does multi-processing differently than Linux and Mac. In windows new processes are spawned and they do not share anything with the process that spawned them. This means the global variable in the main process and the global variable in the spawned process are not the same variable.

In Linux and Mac processes are forked, and they start out knowing everything about the process that spawned them.