On Aug 6, 2:27 am, Ben Finney <[EMAIL PROTECTED]> wrote: > Bruno Desthuilliers <[EMAIL PROTECTED]> writes: > > I've read all the thread, and it seems that your problem is mostly > > to share a single dynamic state (the config) between several > > modules. So I do wonder: have you considered the use of the > > Singleton pattern (or one of it's variants...) ? > > Python modules are effectively singletons. So the idiomatic way to do > this is to create a module for configuration (perhaps named 'config'), > import that into every other module that needs it, and use its > attributes. > > -- > \ "[On the Internet,] power and control will shift to those who | > `\ are actually contributing something useful rather than just | > _o__) having lunch." -- Douglas Adams | > Ben Finney
Yes, that's what I ended up doing. Which is creating a configure module and then importing it into my modules that use it. I did something very similar to the code I posted above. -- http://mail.python.org/mailman/listinfo/python-list