[IPython-dev] QtConsole signal handling

Tiago Coutinho coutinhotiago at gmail.com
Tue Jul 17 10:24:12 EDT 2012


On Fri, Jul 13, 2012 at 5:51 PM, Thomas Kluyver <takowl at gmail.com> wrote:

> On 13 July 2012 10:45, Tiago Coutinho <coutinhotiago at gmail.com> wrote:
> > I know how to check for pylab mode:
> > app = IPython.Application.instance()
> > app.pylab == "qt"
> >
> > ... but how do I find out which is the fronted being used?
>
> Do you need to? If the difference is only with the inline matplotlib
> backend, you can check for that. The terminal can't use the inline
> backend, so if the inline backend is in use, it must be a kernel for
> an advanced frontend (Qt console, notebook, etc.)
>
As far as I understand you suggest to check for inline like:
app.pylab == "inline"

but nothing prevents the user from doing:
ipython console --pylab='inline'

In this case IPython reports a warning that 'inline' is not available as
backend so it will use 'auto' instead **but** if I check
app.pylab it still contains "inline"
I have also tryed:
matplotlib.backends.backend and it
says: 'module://IPython.zmq.pylab.backend_inline'

so how to properly check for the inline backend?


>
> Also, remember that the user can start pylab mode after the
> application starts via the %pylab magic. I don't know if that's
> relevant in your case or not.
>
I won't support this for the moment in my extension so if the user changes
pylab mode, my callback ignores events.
Thanks for the advice

Many thanks for you answers
Regards
Tiago
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20120717/2b9951b1/attachment.html>


More information about the IPython-dev mailing list