Re: import and shared global variables

2006-03-10 Thread Diez B. Roggisch
> has to be imported by others. Would a module global.py (defining glob > and imported by whoever needs it) be more pythonic? I'd say yes. > (I didn't want to do > that because I really want to resist the temptation of introducing > glob1, glob2, glob3...) I miss seeing what that has to do w

Re: import and shared global variables

2006-03-10 Thread Michael Brenner
Ah, thanks everybody! I had thought that, although the name was set to "__main__", the module that was stored in sys.modules was m1 nevertheless, not a copy. Well, having to write "import m1" inside m1.py seems a bit peculiar - it's probably nicer to keep the "__main__" module free from stuff th

Re: import and shared global variables

2006-03-10 Thread Diez B. Roggisch
> I'm implementing a plugin-based program, structured like the example > below (where m1 in the main module, loading m2 as a plugin). I wanted > to use a single global variable (m1.glob in the example) to store some > config data that the plugins can access. However, the output shown > belown see

Re: import and shared global variables

2006-03-10 Thread Tim Hochberg
Michael Brenner wrote: > Hi, > > I'm implementing a plugin-based program, structured like the example > below (where m1 in the main module, loading m2 as a plugin). I wanted > to use a single global variable (m1.glob in the example) to store some > config data that the plugins can access. How

import and shared global variables

2006-03-10 Thread Michael Brenner
Hi, I'm implementing a plugin-based program, structured like the example below (where m1 in the main module, loading m2 as a plugin). I wanted to use a single global variable (m1.glob in the example) to store some config data that the plugins can access. However, the output shown belown seem

import and shared global variables

2006-03-10 Thread Michael Brenner
Hi, I'm implementing a plugin-based program, structured like the example below (where m1 in the main module, loading m2 as a plugin). I wanted to use a single global variable (m1.glob in the example) to store some config data that the plugins can access. However, the output shown belown seems to