Python Forum
Can tkinter monitor dictionary
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can tkinter monitor dictionary
#6
All of this makes sense but not sure how to integrate this with tkinter. As often with my python learning, I can do okay with some more difficult stuff but get hung up on something that should be simple. From what I am reading tkinter doesn't write to gui until you run mainloop() but that then causes the rest of the code to not execute as the app.mainloop() line of code it doesn't get past..


if __name__ == '__main__':
    root = tk.Tk()
    app = Application(master=root)
    app.mainloop()
    print("did you get here?")

    d = MyDict()
    # This code is exactly the same as in an ordinary dictionary.
    d[3] = "foo"
    d.update({4: 'bar', 5: 'spam'})
    del d[4]
    d.clear()
    d.setdefault(8, 'eggs')
    d[8] = 9


Ultimately my __main__ code looks like this as it fires off two threads and I really the code in the threads to update tkinter. Any advice for working in these threads?
	t2 = ProcessReport()
	t2.start()

	t1 = RequestReport(t2)
	t1.start()
Reply


Messages In This Thread
Can tkinter monitor dictionary - by personalt - Jun-20-2020, 12:09 PM
RE: Can tkinter monitor dictionary - by menator01 - Jun-20-2020, 02:06 PM
RE: Can tkinter monitor dictionary - by Gribouillis - Jun-20-2020, 02:41 PM
RE: Can tkinter monitor dictionary - by personalt - Jun-21-2020, 04:35 PM
RE: Can tkinter monitor dictionary - by Gribouillis - Jun-21-2020, 05:07 PM
RE: Can tkinter monitor dictionary - by personalt - Jul-07-2020, 12:41 AM
RE: Can tkinter monitor dictionary - by deanhystad - Jul-07-2020, 03:51 PM

Forum Jump:

User Panel Messages

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