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
#10
NO -- if at all possible do not use global variables or even semi-global variables in most (not all) cases these types of variables are completely unnecessary and always very dangerous and a nightmare if a bug develops because of one. Basically global and semi-global variables are due to lazy minded coding -- a properly designed program should never need these kinds of variables especially with python as your base language. Keep in mind a Class should be autonomous never dependent upon any outside variables and your program should be class-ified thus meaning all variables are contained within their appropriate class. Again I know your pain, having had to do this numerous times myself but the best method I could find is start mapping these variables out as well as the code structure and then figure out where the break-down has occurred and address that point(s) eventually you should be able to eliminate nearly all globals and semi-global variables and have your variables all properly contained. Good luck and above all things just have fun its grand puzzle you are trying to solve one that has numerous pieces that are interchangeable but only the right piece is going to make the picture viewable.
Reply


Messages In This Thread
RE: Managing variables accross a multiple module GUI - by Denni - Jul-05-2019, 01:22 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