A python module for global parameters - is this good practice? -
I am a Mechanical Engineering student, and I am creating a physical simulation using PyODE.
Instead of running everything from a file, I wanted to arrange things in the module, so I was:
- main.py
- Callback.py
- Assistant. P
When I realized that I really need helper.py to refer to the variable, but the main Help was importers!
So my solution was to create a fourth file, which makes the variable home and only import external modules (such as time and random).
So now I have:
- main.py
- callback.py
- helper.py < Li> parameters.py
and in all scripts: import parameters
and use: parameters.foo
or parameters .bar
.
Is this acceptable practice or is it a surefire way to make Python programmer vomiting? :)
Please let me know that this makes sense, or if there is another sensible way to do this!
Thank you, -wave
I try to design my code so that It looks like a pyramid I've found, the cleaner leads to the code.