[IPython-user] checking for qthread
Fernando Perez
Fernando.Perez at colorado.edu
Tue Nov 15 12:00:50 CST 2005
Frédéric Mantegazza wrote:
> Le Mardi 15 Novembre 2005 15:54, Glen W. Mabey a écrit :
>
>
>>Is there some way to check whether ipython was passed the -qthread
>>switch when it was started?
>
>
> You can use sys.argv :
>
> $ > ipython -qthread
> Python 2.3.5 (#2, Aug 30 2005, 15:50:26)
> Type "copyright", "credits" or "license" for more information.
>
> IPython 0.6.15 -- An enhanced Interactive Python.
> ? -> Introduction to IPython's features.
> %magic -> Information about IPython's 'magic' % functions.
> help -> Python's own help system.
> object? -> Details about 'object'. ?object also works, ?? prints more.
>
> In [1]: import sys
>
> In [2]: sys.argv
> Out[2]: ['/usr/bin/ipython', '-qthread']
>
> Hope this helps...
That is correct. Note also that the %config magic will print out the entire
internal configuration structure. This variable is available as
__IPYTHON__.rc, so you can also check programatically:
In [2]: __IPYTHON__.rc.qthread
Out[2]: 1
In [3]: __IPYTHON__.rc.gthread
Out[3]: 0
Every single option passed to ipython is available in the rc struct, along
with some additional things.
Cheers,
f
More information about the IPython-user
mailing list