<HTML dir=rtl><HEAD><TITLE>Re: [Tutor] Variables in workspace</TITLE>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<META content="MSHTML 6.00.2900.3157" name=GENERATOR></HEAD>
<BODY dir=ltr>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2><STRONG>Many thanks</STRONG> to Bob and Kent and all the good people&nbsp;in the tutor forum.</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2>The dir() and del work really well !</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT face=Arial size=2>Eli</FONT></DIV>
<DIV dir=rtl><BR></DIV>
<DIV dir=rtl>
<HR tabIndex=-1>
</DIV>
<DIV dir=rtl><FONT face=Tahoma size=2><B>מאת:</B> bob gailer [mailto:bgailer@alum.rpi.edu]<BR><B>נשלח:</B> ש 10/13/2007 17:35<BR><B>אל:</B> Kent Johnson<BR><B>עותק לידיעה:</B> Eli Brosh; tutor@python.org<BR><B>נושא:</B> Re: [Tutor] Variables in workspace<BR></FONT><BR></DIV>
<DIV>
<P><FONT size=2>Kent Johnson wrote:<BR>&gt; bob gailer wrote:<BR>&gt;&gt; The del statement is the way to delete variables. Since dir() gives<BR>&gt;&gt; you their names one needs use eval.<BR>&gt;&gt;<BR>&gt;&gt; for varName in dir():<BR>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; eval 'del ' + varName<BR>&gt;<BR>&gt; I think del globals()[varName] would work.<BR>Yep. That was nagging a corner of my brain, but not surfacing.<BR><BR><BR></FONT></P></DIV></BODY></HTML>