Su Wei <[EMAIL PROTECTED]> wrote:
> if i want to make a global class to save configuration information of
> app that is read from a xml file,what can i do?
Just put it in a module. Say, 'progconfig.py'. Your configuration
code can then look like:
import progconfig
# parse configuration information from an XML file
for name, value in configuration_information:
setattr(progconfig, name, value)
Now all you have to do to use this information is to import the same
module in your other modules, e.g.:
import progconfig
# do whatever you normally do in this module, e.g.
if progconfig.sayhello:
print "say hello"
STeVe
--
You can wordify anything if you just verb it.
--- Bucky Katt, Get Fuzzy
--
http://mail.python.org/mailman/listinfo/python-list