[IPython-user] [newbie] Ipython variables in external functions?

yardbird yardbird@nerdshack....
Sun May 6 19:07:41 CDT 2007


Hello Ipython developers and users,

I would like to know if it is possible to access interactive Ipython variables 
from an external script/module. What I need to do is to get a list of a 
certain type of objects I've instantiated from the Ipython command line, so 
that I can visualize which instances of these classes are present using a 
graphical widget with PyQt4. I know about the magic command %who_ls and that 
it can be invoked also from _ip, but when called from an external script it 
won't work (ie, it won't list instances even if they are present). I guess 
this is because of scoping and namespace rules, but I'm still trying to wrap 
my brain around python's scoping rules (I come mainly from C++ and I've just 
started with python).

Is that feasible? Can anyone point me in the right direction? I've googled for 
a couple of hours, but it seems like I can't find a solution :/

Thanks and best regards,

  Francesco


More information about the IPython-user mailing list