Say I am importing the module 'foo' into the module 'bar'. Is it possible for me to change a global variable in foo inside bar?
Let the global variable in foo be 'arbit'. Change arbit so that if bar were to call a function of foo that uses this variable, the updated variable is used rather than the one before that.
You should be able to do:
import foo
foo.arbit = 'new value'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With