I've a core code, let's say core.py
with a code which uses as input multiple variables:
- Start date
- End Date
- List of stocks
- Interval
and 2 or 3 more.
Right now, I have the variables hard coded but this means I need to create:
core_1.py
, core_2.py
and more... Of course this is not the way to proceed because it will be imposible to mantain so much replicate code.
What can I do?
I've thought to create a core.py
function which only get variables from variables1.py
, variables2.py
and the important code is only in core.py
. Each variables.py
will give diferent inputs to core.py
, something like this
exec(open("core.py").read())
Anyway, I would love to know if there is a more professional way and easy to mantain. For instance, having a spreadsheet with variables in each row, so each line is a different execution of core.py
. Is there some cleaner way?