Initializing class variables with a file

george young gry at ll.mit.edu
Tue Oct 8 11:45:50 EDT 2002


On 08 Oct 2002 12:50:45 +0300
Karthikesh Raju <karthik at james.hut.fi> wrote:
> 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

You might try the ConfigParser module, it maintains a nicely readable
ascii file of "configuration variables".


 I cannot think why the whole bed of the ocean is
 not one solid mass of oysters, so prolific they seem. Ah,
 I am wandering! Strange how the brain controls the brain!
	-- Sherlock Holmes in "The Dying Detective"



More information about the Python-list mailing list