how to get my own namespace ?

Peter Otten __peter__ at web.de
Wed Oct 17 03:24:08 EDT 2007


stef mientki wrote:

> I want to view my own namespace,
> i.e. to see the modules namespace in the module itself,
> is that possible ?
> 
> I can use
>    dir()
> but I read dir is just a convenience function,
> and besides I want key/value pairs.

Use globals() or vars().

Peter



More information about the Python-list mailing list