I have a module where some constants are defined and also used in several functions. How can I over-ride their values from my main file ?
Say this is the module, test_import.py
MY_CONST = 1
def my_func(var = MY_CONST):
print(var)
And this is my main.py
file:
import test_import
MY_CONST = 2
test_import.MY_CONST = 3
test_import.my_func()
This code still prints "1". I want it to print some other value (obviously, without passing a value when calling my_func()
)