Access to main namespace from imported module?

Dale Strickland-Clark dale at riverhall.NOTHANKS.co.uk
Mon Apr 1 14:13:32 EST 2002


Chris Liechti <cliechti at gmx.net> wrote:

>Dale Strickland-Clark <dale at riverhall.NOTHANKS.co.uk> wrote in 
>news:re8haugrbcchbephckl9t1p1s27tvg18hr at 4ax.com:
>
>> Just curious, like, but is it possible for an included module to
>> reference the namespace of the outer-most module, "__main__".
>
>just do an import
>>>> import __main__
>>>> __main__.var = 7
>etc.
>
>chris


Aha!

Cheers.
--
Dale Strickland-Clark
Riverhall Systems Ltd



More information about the Python-list mailing list