XML Considered Harmful
Karsten Hilbert
Karsten.Hilbert at gmx.net
Tue Sep 28 14:30:54 EDT 2021
Am Tue, Sep 28, 2021 at 12:53:49PM -0500 schrieb Michael F. Stemper:
> This sounds like a suggestion that I hard-code the data into a
> module. I suppose that I could have half-a-dozen modules with
> different data sets and ln them as required:
>
> $ rm GenData.py* FuelData.py*
> $ ln gendata1.py GenData.py
> $ ln fueldata3.py FuelData.py
vi data.py
generators = {}
generators['name1'] = {'fuel': ..., ...}
generators['name2'] = {...}
...
vi simulation.py
import sys
import data
generator = data.generators[sys.argv[1]]
run_simulation(generator)
or some such ?
Your data "format" is ... Python code.
Karsten
--
GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B
More information about the Python-list
mailing list