[python-win32] How to get all the variables in a python shell

Tim Golden mail at timgolden.me.uk
Thu May 29 10:18:19 CEST 2008


lixinyi.23 at gmail.com wrote:
> 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?

I stronly suggest you look at IPython [1]. To do what I think
you're describing, you'd need to hack or reimplement the interpreter.
And that's what they've done. ISTR that they even have a branch
which is dealing with parallel instances.

TJG

[1] http://ipython.scipy.org/moin/


More information about the python-win32 mailing list