<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 17, 2014 at 1:19 AM, Johann Rohwer <span dir="ltr"><<a href="mailto:jr@sun.ac.za" target="_blank">jr@sun.ac.za</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div id=":247" class="a3s" style="overflow:hidden">I can think of various hacks on how to achieve this but would like to know if<br>
there is The Right Way (TM) and if so, what it is.<br></div></blockquote></div><br>There is no 'right way' to do this, because the question is in a sense ill-posed, given the design of IPython: any given IPython kernel can be *simultaneously* connected to a notebook, a Qt console and a text console (or more than one).</div>

<div class="gmail_extra"><br></div><div class="gmail_extra">So a python process can't really answer 'am I in a Qt console?', since the answer can be simultaneously yes, no, or both, and it can change at any point in time during the life of the process (since clients can connect and disconnect).</div>

<div class="gmail_extra"><br></div><div class="gmail_extra">Cheers</div><div class="gmail_extra"><br></div><div class="gmail_extra">f<br><br clear="all"><div><br></div>-- <br>Fernando Perez (@fperez_org; <a href="http://fperez.org" target="_blank">http://fperez.org</a>)<br>

fperez.net-at-gmail: mailing lists only (I ignore this when swamped!)<br>fernando.perez-at-berkeley: contact me here for any direct mail<br>
</div></div>