[IPython-User] query frontend?

Brian Granger ellisonbg@gmail....
Tue Apr 10 20:33:19 CDT 2012

Given the architecture of IPython, this doesn't even make sense to
ask.  The kernel can have multiple different frontends attached to it,
even simultaneously.  You could have a qtconsole and notebook attached
to a single kernel and the kernel has absolutely no way of knowing
which commands are coming from the qtconsole and which are coming from
the notebook.  That the kernel knows nothing about the frontends is
not an accident, but rather a deliberate design decision that I don't
see us changing anytime soon.

But maybe the better question is this: what exactly are you trying to
do?  Maybe there is a different way of approaching it that would make
more sense.  Or it might be that there are other abstraction IPython
has or might have to help solve this issue.



On Tue, Apr 10, 2012 at 5:24 PM, mqk <kuhlen@gmail.com> wrote:
> Hi
> Is there some way to find out from within a python module whether it is
> being imported from a web notebook rather than from the command line?
> Something akin to if __name__ == "__main__"?
> Thanks,
> Mike
> --
> View this message in context: http://python.6.n6.nabble.com/query-frontend-tp4790920p4790920.html
> Sent from the IPython - User mailing list archive at Nabble.com.
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user

Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger@calpoly.edu and ellisonbg@gmail.com

More information about the IPython-User mailing list