global variables in module

Zunbeltz Izaola zunbeltz at wm.lc.ehu.es.XXX
Wed Feb 4 11:10:52 CET 2004


Hi to all!

I'm writing a GUI with wxPython. I want to save preferences and defaults
values in a configuration file. I'm going ot parse this file using 
ConfigParse from the standar library.

In my application i've 

MyApp(wxApp):
        ...
        def OnInit(self):
            ..
                cf = ConfigParse.ConfigParse()
                cf.read(open("defaults.cfg"))

How can i use cf in other modules of the program. Did I need declare cf
global, or make it a module variable, ... Any hint, please

TIA

Zunbeltz



More information about the Python-list mailing list