question about loading variables from a file...

georgeryoung at gmail.com georgeryoung at gmail.com
Mon Nov 6 08:08:36 CET 2006


On Nov 5, 2:26 pm, avidfan <n... at nowhere.com> wrote:
> Can someone offer some advice as to how the best way to approach this
> might be?
>
> I am trying to write a generic python script to build out some
> applications, so the python script will be generic enough to work for
> all of them, but it needs to 'source' a file that contains app and
> environment specific variables.
>
> I have used WLST, which provides the loadProperties() method for
> reading values for weblogic domains, but I'm trying to find the best
> way to do the same sort of thing in python...

Try configparser:
 http://docs.python.org/lib/module-ConfigParser.html




More information about the Python-list mailing list