Is it possible to declare a global variable that is invisible to the importing script?
For example, in script a.py I have a variable var_a that is accessible to any function in a.py. However, in script b.py that imports a.py, I want var_a to be inaccessible.
(A somewhat similar concept to C's static module variables)
In a.py:
var_a = "hello"
print("In script a.py:", var_a)
In b.py:
from a import var_a
print("In script b.py:", var_a)
Testing:
$ python3 b.py
In script a.py: hello
In script b.py: hello
I would like to get an error when referencing var_a from b.py.
_var_aand that tells everyone "don't touch this, and if you do, it's your own fault if anything goes wrong"