view workspace, like in MatLab ?

Nick Vatamaniuc vatamane at gmail.com
Wed May 9 06:05:32 EDT 2007


On May 9, 5:00 am, Stef Mientki <S.Mientki-nos... at mailbox.kun.nl>
wrote:
> hello,
>
> is there a function / library / IDE that displays all the user defined variables,
> like the workspace in MatLab ?
>
> thanks,
> Stef Mientki

Stef,


In the Python interactive prompt you can try:

[var for var in dir() if not (var.startswith('_') or var=='var')]

Example:
-------------------
>>> a=10
>>> b=20
>>> [var for var in dir() if not (var.startswith('_') or var=='var')]
['a', 'b']
>>>
-------------------

Hope that helps,
Nick Vatamaniuc




More information about the Python-list mailing list