Say I have a module params.py
in which a bunch of variables are declared:
a = 0.2
b = 0.4
...
In using this module, I want to import its namespace with * for easier referencing. But in that case it seems I'm only able to access the values of the parameters but cannot reset them:
from params import *
def test1():
print(a) #this works: printing out the value of params.a
def test2():
a= 0.5 #doesn't work: does not change the value of params.a
Trying to reference the variable as params.a = 0.5
also doesn't work (gives a NameError as "params" is not defined)
My question: How can one set/reset the value of a variable that has been imported this way?