"alex23" <[EMAIL PROTECTED]> wrote:

> Hendrik van Rooyen wrote:
> > "robert" <[EMAIL PROTECTED]> wrote:
> > > Fredrik Lundh wrote:
> > > >
http://www.effbot.org/pyfaq/how-do-i-share-global-variables-across-modules.htm
>
> > > Or worse style - if you are too lazy to create a extra global variables
module
> > > (ab)use the __main__ module als "global":
> > > import __main__
> > > __main__.mysemphore += 1
>
> > Thanks - how could you possibly have guessed that I am lazy - does it show
that
> > much?  *WEG*
>
> You could merge the two approaches and bind a more explicit name to
> __main__:
>
> import __main__ as config
>
> config.mysemaphore = 0
>
> It's a little clearer what you're subverting __main__ for here :)
>
> - alex23

Thanks - clever and clear!

- Hendrik

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to