[SciPy-user] Using external files in a simulation

Jim.Vickroy at noaa.gov Jim.Vickroy at noaa.gov
Mon Jul 25 09:55:30 EDT 2005


Hello David,

In case you are not familiar with them, you might want to take a look 
at the following standard Python modules:

ConfigParser
csv
optparse
pickle

I have used all of the above at one time or another (frequently in 
combination) to manage configuration information.

-- jv

----- Original Message -----
From: "Howey, David A" <d.howey at imperial.ac.uk>
Date: Monday, July 25, 2005 7:16 am
Subject: [SciPy-user] Using external files in a simulation

> I'm about to embark on rewriting some code that I have in matlab, 
into
> python, with a number of improvements, and making good use of 
python's
> object-oriented approach. Before I start, however, I wondered if I 
> couldask the advice of the list, as I'm sure you will have had 
> experiencewith this sort of thing:
> 	As part of the simulation, I want to read in start up 
parameters
> (physical properties, initial + boundary conditions etc.) from an
> external text file (traditionally I suppose you might call this a 
> '.dat'file). In matlab, I was just using a matlab script for this 
> (ie just
> like a bit of the main program, but in another file, allowing easy
> changes for different simulations). I could do the same in python and
> just import the data based on a filename name entered by the user. Is
> this a good approach? It makes sense to keep it simple, although I 
was
> toying with the idea of using XML files for such data storage, to 
> allowthem to be manipulated by some other front/back end stuff. 
> Seems a bit
> pointless to add unnecessary complexity at this stage, though.
> 
> I'm not sure if I've put that across particularly clearly.. but.. any
> thoughts?
> 
> Dave
> 
> Ps. A slight subtlety is that in fact my simulation engine is 
> modular to
> cope with lots of different system configurations and I actually 
> need to
> store an arbitrary list of objects which are then solved in 
> sequence for
> a bunch of unknowns. I need to represent this somehow in an 
> external set
> up file as well. Aargh!
> 
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.net
> http://www.scipy.net/mailman/listinfo/scipy-user
> 




More information about the SciPy-User mailing list