Well, I'm a newbie myself, and that was a big problem for me, and I think that this is related to the wording of the question (I formulated it the same way as when searching on Google and could not find an answer that related to the fact that I tried to do). Please someone correct me if there is a reason why I should not do this, but ...
The best way to customize the list of global variables is to set a class for them in this module.
class globalBS(): bsA = "F" bsB = "U"
Now you can call them, change them, etc. in any other function, referring to them as such:
print(globalBS.bsA)
will print "F" in any function of this module. The reason for this is because python treats classes as modules, so it works well for creating a list of global variables, for example, when trying to create an interface with several parameters, such as I'm doing now, without copying and pasting a huge list of globals in each function. I would just keep the class name as short as possible - perhaps one or two characters instead of a whole word.
Hope this helps!
source share