Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrochart committed Oct 19, 2023
1 parent be66d2f commit bc2fdad
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# xeus-qt-python

[![CI](https://github.com/DerThorsten/xeus-qt-python/actions/workflows/main.yml/badge.svg)](https://github.com/DerThorsten/xeus-qt-python/actions/workflows/main.yml)
[![Build Status](https://github.com/jupyter-xeus/xeus-qt-python/workflows/CI/badge.svg)](https://github.com/jupyter-xeus/xeus-qt-python/actions)

You will need to compile [xeus-qt](https://github.com/jupyter-xeus/xeus-qt) and [xeus-qt-python](https://github.com/jupyter-xeus/xeus-qt-python) (this repository) from source.
First clone these two repositories under `path/to/xeus-qt` and `path/to/xeus-qt-python`, respectively (or whatever place you'd like).
Expand All @@ -25,9 +25,12 @@ python kernel_widget.py
```

This launches JupyterLab in a Qt application. If you look at running kernels in the left tab, you will see a kernel named `qt-python`.
Right-click on it and choose "New Console for Kernel". Now go to the file browser and double-click on the `my_notebook.ipynb` notebook.
In the "Select Kernel" menu, under "Use Kernel from Other Session" at the bottom, select "Console 1".
Right-click on it and choose "New Console for Kernel". This console won't be used, it is just a workaround to create a session with this kernel, so that we can then open a notebook using this session (this has to be improved in JupyterLab).

Now go to the file browser and double-click on the `my_notebook.ipynb` notebook.
In the "Select Kernel" menu, under "Use Kernel from Other Session" at the bottom, select "Console 1" (or whatever number, this is the console we previously created).
Now execute all the cells. The last one should display a button with the name "black magic" at the bottom of the Qt application.
If you click on it, it should display "hello from here" inside the last cell.

That's it, you've just connected your custom Qt application to Jupyter!
You added a button to your Qt application from a Jupyter notebook, which when clicked on, prints a message to a notebook cell output.

0 comments on commit bc2fdad

Please sign in to comment.