Initializing class variables with a file
Karthikesh Raju
karthik at james.hut.fi
Tue Oct 8 05:50:45 EDT 2002
Hi All,
Starting to slowly shift from Matlab to python. Was wondering how to
do the following:
1. i want to initialize all the class variable thro the __init__(self)
method, but it should be initialized thro a file.
i set up the parameters for the expt in the file and the
self.a,b,c = are assigned by reading this file
How does one do it.
2. i want to store the results in a file. Can i use c/pickle as a
substitute for the 'mat' format in Matlab
3. Is it a good design to have all the variables as self. variables
and have methods return values if and when needed.
Thankx in advance
karthik
--
-----------------------------------------------------------------------
Karthikesh Raju, email: karthik at james.hut.fi
Researcher, http://www.cis.hut.fi/karthik
Helsinki University of Technology, Tel: +358-9-451 5389
Laboratory of Comp. & Info. Sc., Fax: +358-9-451 3277
Department of Computer Sc.,
P.O Box 5400, FIN 02015 HUT,
Espoo, FINLAND
-----------------------------------------------------------------------
More information about the Python-list
mailing list