[Tutor] Variables in workspace

Kent Johnson kent37 at tds.net
Sat Oct 13 16:49:12 CEST 2007


bob gailer wrote:
> The del statement is the way to delete variables. Since dir() gives you 
> their names one needs use eval.
> 
> for varName in dir():
>     eval 'del ' + varName

I think del globals()[varName] would work.

Kent


More information about the Tutor mailing list