qtconsole icon indicating copy to clipboard operation
qtconsole copied to clipboard

Issue with executing cells when launching a Qt console from a Qt console

Open astrofrog opened this issue 9 years ago • 1 comments

I am trying to launch a Qt console from an app launched from a Qt console (so to simplify, I am trying to launch a Qt console inside a Qt console). If I type:

%gui qt

from __future__ import absolute_import, division, print_function

from IPython import get_ipython
from ipykernel.connect import get_connection_file
from qtconsole.rich_jupyter_widget import RichJupyterWidget
from qtconsole.client import QtKernelClient

shell = get_ipython()

client = QtKernelClient(connection_file=get_connection_file())
client.load_connection_file()
client.start_channels()

control = RichJupyterWidget()
control.kernel_client = client
control.shell = shell

control.show()

inside a qtconsole, I get a new console, but in the new console it seems that I have to press shift-enter in that console to get cells to execute. Is there a way to make the new qtconsole behave 'normally', i.e. execute cells after pressing only enter?

Original qtconsole:

screen shot 2017-02-08 at 13 53 28

New qtconsole:

screen shot 2017-02-08 at 13 53 31

astrofrog avatar Feb 08 '17 13:02 astrofrog

I suspect that gets messy because the second console has its UI and its kernel in the same process, but I don't know precisely what goes wrong.

takluyver avatar Feb 08 '17 13:02 takluyver