[IPython-User] How to check that a python script is called from ipython and check if qt is enabled

Eleftherios Garyfallidis garyfallidis@gmail....
Wed Oct 24 09:52:58 CDT 2012

On Wed, Oct 24, 2012 at 4:07 PM, Thomas Kluyver <takowl@gmail.com> wrote:

> On 24 October 2012 14:55, Matthias BUSSONNIER
> <bussonniermatthias@gmail.com> wrote:
> > I am especially interested to know if --gui=qt is used.
> >
> >
> > Script are run in the kernel that has no notion of what frontend it is
> > attached to.
> Isn't the --gui option for the kernel to integrate with event loops,
> though? So it should be possible to see it.

Yes, --gui is for event loops as you suggest.

> You can check if IPython is loaded by looking in sys.modules, or
> looking for get_ipython in the builtins. I'm not sure if there's a
> good way to check if you're called from user code in IPython
> (inspecting the stack probably isn't a good way).
> Thank you Thomas will give it a go.

> Thomas
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20121024/dc98f742/attachment.html 

More information about the IPython-User mailing list