Python Forum
[PyQt] Managing variables accross a multiple module GUI
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyQt] Managing variables accross a multiple module GUI
#3
Both approach can be useful. I use the second for static variable (ie. project id):

__id__.py

ID = "obsuite"
HELP = ["..."]
__init__.py

try:
    from .__id__ import ID, HELP
except ImportError:
    from __id__ import ID, HELP
And the first approach for common variable across modules/plugins. Like Denni suggested, instead of passing variable I pass self as the module parent. The objects are accessed as pointers, so any change you make is passed upstream.

This is kind of a large project, but still you may have a look to see how it can be implemented:
https://gitlab.com/william.belanger/obsu...er/obsuite
Reply


Messages In This Thread
RE: Managing variables accross a multiple module GUI - by Alfalfa - Jun-27-2019, 03:57 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question [Tkinter] Defining a self made module's function to interact with the main .py variables? Gilush 9 4,500 Jun-08-2020, 09:08 AM
Last Post: Gilush

Forum Jump:

User Panel Messages

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