Consider the following code:
#main.py
From toolsmodule import *
database = "foo"
#toolsmodule
database = "mydatabase"
As it seems, this creates one variable in each module with different content. How can I modify the variable inside toolsmodule from main? The following does not work:
toolsmodule.database = "foo"
Sounds like yet another of the multitude of good reasons not to use
from toolsmodule import *.If you just do
import toolsmodule, then you can dotoolsmodule.database = 'foo', and everything is wonderful.