How can i get values from a init - file

Jeff Hinrichs jlh at home.com
Thu Nov 29 19:34:25 EST 2001


Check out the ConfigParser class.
http://www.python.org/doc/current/lib/module-ConfigParser.html

----- Original Message ----- 
From: "martin z" <u9825527 at minteka.dbai.tuwien.ac.at>
Newsgroups: comp.lang.python
To: <python-list at python.org>
Sent: Thursday, November 29, 2001 3:52 AM
Subject: How can i get values from a init - file


> 
> I want to make a init - file, where i can set value for variables in
> my programm. 
> now i have in my programm a class : 
> 
> class TEST:
>   def __init__(self):
>      self.a = 12
>      self.b = 13
>      self.c = 14
>      self.d = 15
> 
> 
> I want to make a init- file like (or a other style. It is free; But i
> do not want write self.a = 12   because. other peoble should also use)
> : 
> a  12
> b 13 
> c 14
> d 15 
> 
> I need a init file to save the settings of my programm. 
> How can i read the values of the init file into my programm without
> asking all cases. ? e.g: 
> If s ==  a then 
>   self.a = s1
> 
> 
> I hope you understand my problem. 
> 
> martin
> -- 
> http://mail.python.org/mailman/listinfo/python-list





More information about the Python-list mailing list