I would like to run a file1, from another file2, while changing one of its variables. Something like this:
file1.py
a = 1
b = 1
c = 1
# Then:
# Countless functions depending on a, b, c, etc., depending on each other in complicated ways.
# Results from these functions are plotted and exported
file2.py
# Pseudo-code:
import file1 with (a = 0) # runs file1, exporting all results, as if file1 had a = 0.
What is the simplest way to do this, considering I have too many variables, complicated functions and dependencies in file1.py?
file1.pyto read a configuration or at least get its variables from a common module that you can import first? Changingfile1.aafter import can only effect uses ofaafter that point.file1.pycould use some refactoring.