How to get all the variables in a python shell

Lie Lie.1296 at
Sun Jun 1 20:55:21 CEST 2008

On May 29, 1:47 pm, lixinyi... at wrote:
> Hi!
> I'm currently working on a scientific computation software built in
> python.
> What I want to implement is a Matlab style command window <->
> workspace interaction.
> For example, you type 'a=1' in the command window, and you see a list
> item named 'a' in the workspace.
> You double click the icon of the item, and you see its value. You can
> modify the value of the list item,
> 1 -> 100 etc,  after which if you go back to the command window and
> type 'a'  and press enter, you see that
> varable a's value has been changed to 100.
> So my question is : if you have two DOS command windows running under
> WINDOWS OS, how can you make them share the same internal variable
> buffer? Or is there any easier way to implement such kind of
> interaction?
> Maybe I could just build a small database to store all the values and
> access them from both programs, but chances are sometimes I have to
> deal with big arrays, and they will eat extra memory if I keep them in
> a database. Is there anyway to access a shell's local memory buffer?
> I tried to use shell.interp.locals() in wxPython, but there's too many
> variables in the list which I don't actually need.
> Come on guys, give me some ideas. Thanks in advance!

As an addition: Don't try to share data between windows, it's messy,
fragile, and easy to make bugs.

PS: Do not confuse Lie (Me) and Lee (OP)

More information about the Python-list mailing list