A function uses the globals of the module it's defined in. Instead of setting a = 3
, for example, you should be setting module1.a = 3
. So, if you want cur
available as a global in utilities_module
, set utilities_module.cur
.
A better solution: don't use globals. Pass the variables you need into the functions that need it, or create a class to bundle all the data together, and pass it when initializing the instance.