Value accessibility across files in Python
Question: I have a file structure as follows

    
    
    Folder1:
    Folder2
    Class-with-global-variables-and-static-methods-to-modify-them.py
    
    Folder2:
    Myfile-1.py
    Myfile-2.py
    Master.py
    

Master.py imports the other 2 files in its folder. The " Class-with-global-
variables-and-static-methods-to-modify-them.py" is never instantiated and the
global values in it are modified via static methods. But I want these
modifications to persist globally.

ex:

    
    
     class Class-with-global-variables-and-static-methods-to-modify-them:
    
     ...
     ...
     importance = 0
     ...
     ...
     @staticmethod
     def modifyImportance(value):
          Class-with-global-variables-and-static-methods-to-modify-them.imortance = 1
    

If Myfile-1.py modified the value of importance I want the new value of
importance to be available to Myfile-2.py if It tried to access it.


Answer: What you have already would work, but you're doing it wrong.

There is no point in Python in having a class that is never instantiated and
which only contains static variables. Python is not Java, and doesn't require
classes. Instead, just define the variables at module level and modify them
directly.

