Add lists to class?

BBands bbands at gmail.com
Fri Sep 2 13:10:09 EDT 2005


That's interesting and I take your point. Maybe there is a better way.
Here is what I am doing now. (working)

I start with a text file of ticker symbols. I read each symbol and
stick it in a list, retrieve the data for it from MySQL, do a trivial
smoothing and pass the data to a modeling routine. I read the tickers
into a list, self.symbols. Then for each ticker I create a list,
self._0, self._1, ... and a list for the smoothed values,
self._0_smooth, self._1_smooth, ... I end up with data I can access
with self.__dict__["_" + str(var)] and a matching symbol which I can
access self.symbols[var].

Ideas for a better approach gladly accepted.

    jab




More information about the Python-list mailing list