[Tutor] printing variable name and value?

Emile van Sebille emile@fenx.com
Mon, 29 May 2000 11:02:16 -0700


Just be careful about adding entries.  It's not guaranteed
to work right.

From the docs:

locals ()
    Return a dictionary representing the current local symbol
    table. Warning: the contents of this dictionary should not
    be modified; changes may not affect the values of
    local variables used by the interpreter.

Even-though-it-may-look-like-it-ly y'rs,

Emile van Sebille
emile@fenx.com
-------------------


----- Original Message -----
From: Borgulya Gabor <borgulya@pons.sote.hu>
To: Emile van Sebille <emile@fenx.com>
Sent: Monday, May 29, 2000 10:12 AM
Subject: Re: [Tutor] printing variable name and value?


> On Sun, 28 May 2000, Emile van Sebille wrote:
> > Does this do it?
> >
> > def show_vars(varlist, namespace):
> >   for var in varlist:
> >     print "%s = %s" % (var, namespace[var])
> Hello, thanks for the idea. I is not exactly what I wanted, but you
have
> tought me something: I was not aware of the possibility of retrieving
the
> namespaces az dictionaries.
> Thanks,
> Gabor
>
>