Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Values missing from console when running automatically #572

Open
keziah55 opened this issue Mar 23, 2023 · 0 comments
Open

Values missing from console when running automatically #572

keziah55 opened this issue Mar 23, 2023 · 0 comments

Comments

@keziah55
Copy link

keziah55 commented Mar 23, 2023

I'm trying to automatically run a sequence of commands in the QtConsole. I'm doing this by listening for 'execute_reply' messages from the kernel_client.shell_channel and using these to trigger the next command. However, some of the commands are missing from the console.

I've created a minimal working example from the embed_qtconsole.py example:
embed_qtconsole.py.txt
To demonstrate the problem, click 'Connect signal', 'then 'Run'.

Sample output:

In [1]: i = 1

In [2]: i = 2


In [3]: i = 4

In [4]: i = 5

In [5]: i = 6

In [6]: 

In [7]: i = 7


In [8]: i = 9

In [9]: 

In [10]: 

As you can see, in this instance i = 3 and i = 8 are missing and the commands are out of sync with the input prompts, although the total number of input prompts is correct.

I'm guessing this is a timing issue, and the 'execute_reply' is being received before the corresponding IO operation is complete. Is there a better way to implement automatic execution? Perhaps another signal that is emitted after all processing of a command is completely finished? (I've tried also waiting for a 'status idle' message from the iopub_channel but it didn't help).

I'm using python 3.8 and qtconsole version 5.4.1 (on CentOS 7).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant