"Eli Brosh" <[EMAIL PROTECTED]> wrote
> The dir() and del work really well !
I meant to add that if you look at the names a lot then you migt
prefer PyCrust asa shell rather than IDLE. PyCrust has a small
namespace window on permanent display wich shows all of
the names dynamically in an ex
] Variables in workspace
Kent Johnson wrote:
> 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 globa
On Sat, Oct 13, 2007 at 11:04:05AM +0200, Eli Brosh wrote:
>
> Hello
> I am working with python interactively using IDLE.
>
> Since starting, I defined some variables:
> s='string'
> a=1
> b=[1,2]
> c=1.02
>
> and so on.
>
> Now, I want to know which variables are in my workspace.
> That is, is
"Eli Brosh" <[EMAIL PROTECTED]> wrote
> Now, I want to know which variables are in my workspace.
Try dir()
That should give you the names in the current namespace.
You will see some names you didn't define too.
dir()is a really helpful command when you want to see whats possible.
>>> dir('')
Kent Johnson wrote:
> 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.
Yep. That was nagging a corner of my brain,
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
___
Tutor maillist -
Eli Brosh wrote:
>
> Hello
> I am working with python interactively using IDLE.
>
> Since starting, I defined some variables:
> s='string'
> a=1
> b=[1,2]
> c=1.02
>
> and so on.
>
> Now, I want to know which variables are in my workspace.
> That is, is there a command similar to "who" in MATLAB ?
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
Hello
I am working with python interactively using IDLE.
Since starting, I defined some variables:
s='string'
a=1
b=[1,2]
c=1.02
and so on.
Now, I want to know which variables are in my workspace.
That is, is there a command similar to "who" in MATLAB ?
I want to call "who"
and get the output: