[IPython-dev] Comments on IPython Qt widgets

Robert Kern robert.kern at gmail.com
Mon Feb 7 23:40:46 EST 2011


On 2011-02-07 22:30 , Brian Granger wrote:
> On Mon, Feb 7, 2011 at 8:25 PM, Robert Kern<robert.kern at gmail.com>  wrote:
>> On 2011-02-07 22:15 , Brian Granger wrote:
>>> Charlie,
>>
>>>> - Currently, the only IPython kernel available for use with the Qt widget
>>>> runs the IPython interpreter in a separate process.  For QGIS, it would be
>>>> very nice to have the option of running an IPython kernel inside the same
>>>> process as the Qt widgets.  IPython would then have direct access to the
>>>> QGIS interface and would be able to inspect and operatie on the PyQt4
>>>> objects that compose the GUI providing a powerful tool for users performing
>>>> spatial analysis and developers building plugins.
>>>> Are there any plans to develop IPython kernels that do not run
>>>> in separate processes?  I spent a few days trying to build one myself by
>>>> wrapping an InteractiveShell, but I feel like I am flailing a little bit
>>>> when it comes to creating a kernel_manager that will integrate with the Qt
>>>> frontend.  If anyone has any design advice on how to implement an in-process
>>>> kernel I would love to hear it.
>>>
>>> There is interest in having an in process IPython, but I honestly
>>> think it will not work very well at all.  This is mostly because of
>>> the GIL.
>>
>> I don't see why. The shell may block. This is not a big deal. This is what
>> people expect of shells embedded in apps.
>
> It is not the blocking of the shell that is the problem, it is the
> blocking of the *entire* app that is the problem.

I meant "The shell may block [the app]". It would be *ideal* if the shell didn't 
block the app, but that doesn't mean that a blocking shell doesn't work well. 
Remember, every UI interaction can potentially trigger a long blocking call, 
unless if that part of the app is carefully written to avoid that. The GIL issue 
you mention applies to any GUI application written in Python, but we manage to 
make usable applications just fine.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco




More information about the IPython-dev mailing list