namespace question

Alex Martelli aleaxit at yahoo.com
Sat Sep 4 05:00:29 EDT 2004


Elaine Jackson <elainejackson7355 at home.com> wrote:

> It's what I want in the sense that it returns the correct dictionary when
> globals is invoked interactively. What I want is to have a function that
> can be
> imported into the interpreter and that will return that same dictionary.

so what's wrong with:

def main_dictionary():
    import __main__
    return vars(__main__)


???



More information about the Python-list mailing list