Python Forum
[Tkinter] Making entry global in tkinter with multiprocessing
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] Making entry global in tkinter with multiprocessing
#1
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
Larz60+ write Jan-21-2022, 11:10 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Reply
#2
https://stackoverflow.com/questions/6731...ssing-pool

Problem fixed. I used this method and it worked somehow. :) Thanks for reading and putting effortanyway
Reply
#3
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tkinter] Updating Tkinter label using multiprocessing Agusms 6 3,138 Aug-15-2022, 07:10 PM
Last Post: menator01
  Tkinter Exit Code based on Entry Widget Nu2Python 6 2,992 Oct-21-2021, 03:01 PM
Last Post: Nu2Python
  [Tkinter] Update variable using tkinter entry methon drSlump 6 5,203 Oct-15-2021, 08:01 AM
Last Post: drSlump
  Tkinter | entry output. Sap2ch 1 1,996 Sep-25-2021, 12:38 AM
Last Post: Yoriz
  .get() from generated Entry widgets in tkinter snakes 4 4,223 May-03-2021, 11:26 PM
Last Post: snakes
  [Tkinter] tkinter global variable chalao_adda 6 11,035 Nov-14-2020, 05:37 AM
Last Post: chalao_adda
  Entry Validation in tkinter shahulvk 4 16,331 Oct-28-2020, 10:12 PM
Last Post: joe_momma
  [Tkinter] Getting Input from Tkinter Entry juliabrushett 6 21,375 May-30-2020, 03:29 PM
Last Post: Larz60+
  Converting Entry field value to integer in tkinter scratchmyhead 2 4,956 May-11-2020, 03:41 PM
Last Post: scratchmyhead
  [Tkinter] Tkinter adding entry values scratchmyhead 1 2,204 May-04-2020, 05:21 AM
Last Post: Yoriz

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020