file object as container class

Pettersen, Bjorn S BjornPettersen at fairisaac.com
Tue Oct 14 19:09:28 EDT 2003


> From: Matthew Wilson [mailto:mwilson at sarcastic-horse.com] 
> 
> I have a bunch of classes that track data for time series.  The
classes are
> really just glorified dicts where the key is a date object, and the
value is the
> value as of that date.
> 
> I want a way to store a bunch of these tseries objects into a file
object.  I
> want to be able to open the file object, iterate through all
timeseries, then
> create some new tseries, and add them to the file object.  I also want
to be
> able to delete tseries from the file object.
> 
> Can anyone give me any pointers on how to write a file object 
> like this?

Any reason why you don't want to use a real database?

(take a look at the shelve and bsddb modules if you're set on going with
files..)

-- bjorn





More information about the Python-list mailing list