Re: [Tutor] Variables in workspace

2007-10-15 Thread Alan Gauld
"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

Re: [Tutor] Variables in workspace

2007-10-14 Thread Eli Brosh
] 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

Re: [Tutor] Variables in workspace

2007-10-13 Thread Dave Kuhlman
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

Re: [Tutor] Variables in workspace

2007-10-13 Thread Alan Gauld
"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('')

Re: [Tutor] Variables in workspace

2007-10-13 Thread bob gailer
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,

Re: [Tutor] Variables in workspace

2007-10-13 Thread Kent Johnson
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 -

Re: [Tutor] Variables in workspace

2007-10-13 Thread bob gailer
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 ?

Re: [Tutor] Variables in workspace

2007-10-13 Thread Kent Johnson
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

[Tutor] Variables in workspace

2007-10-13 Thread Eli Brosh
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: