[Tutor] Variables in workspace

Kent Johnson kent37 at tds.net
Sat Oct 13 14:54:27 CEST 2007


Eli Brosh wrote:
> I am working with python interactively using IDLE.
> 
> Since starting, I defined some variables:
> 
> Now, I want to know which variables are in my workspace.

==== RESTART ================================
 >>> dir()
['__builtins__', '__doc__', '__name__']
 >>> s='string'
 >>> a=1
 >>> dir()
['__builtins__', '__doc__', '__name__', 'a', 's']

> Now, is there a way to clear some or all the variables in that list ?

 >>> del a
 >>> del s
 >>> dir()
['__builtins__', '__doc__', '__name__']

To clear all you can Restart Shell from the menu.

Kent


More information about the Tutor mailing list