[IPython-user] Embedded IPython and -pylab

Inigo Aldazabal Mensa inigo_aldazabal@ehu...
Wed Sep 3 03:05:54 CDT 2008

Hi all,

The thing is, if I try to call IPython from a script with -pylab as the
argv, the script neither loads the pylab namespace nor it is in matplotlib
threaded mode. So that in

>>> ipshell = IPShellEmbed('-pylab')
>>> ipshell()

the -pylab seems to have no effect.

From my search I found that I can go into pylab mode doing eg:

>>> sys.argv = [sys.argv[0], '-pylab']
>>> IPython.Shell.start().mainloop()

But then in this case I don't get the previous variable space so I can not
interact with it.

The idea of course is doing some number-crunching and at some point 
stopping and goint into IPython to make some plots, etc. in a non-blocking 
manner a la "IPython -pylab".

I found a couple of posts regarding this, but no clear answers about it. Is
it not possible to do it or I'm missing something here?



More information about the IPython-user mailing list