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

Starting a python-kernel in a C++ application #546

Open
MaximilienNaveau opened this issue Jul 20, 2022 · 1 comment
Open

Starting a python-kernel in a C++ application #546

MaximilienNaveau opened this issue Jul 20, 2022 · 1 comment

Comments

@MaximilienNaveau
Copy link

MaximilienNaveau commented Jul 20, 2022

Dear all,

I am new to xeus and I am not sure it is done for my purpose.
I am developing a C++ application with an embedded python interpreter (currently taken from boost::python).
The idea it to interact remotely with this embedded python-interpreter.

Hence at first we use ROS but it is less than convenient as we have to re-implement the interpreter as ROS only give us a way to call simple function remotely.

What I would like to do is to depend on a C++ library (xeus-python?) in order to spawn 2 things:

  • a python-kernel from C++
  • a communication channel compatible with tools like jupyter console --existing
  • a way to send python commands and python scripts to be executed remotely into the C++ python-kernel

Do you think that your tool is the right choice?
And where to look for the C++ API.
Thank you very much.

@JohanMabille
Copy link
Member

Hi,

I think xeus-python can help you ;) The API is split between xeus-python, specific to python, and xeus, a native implementation of the jupyter protocol).

Most f the time, when building a kernel, you want to put together the different blocks provided by these libraries, that is: a server (for the remote communication), an interpreter, and optional things such as an history manager, a debugger, etc.

You can have a look at the main file to see how these pieces are put together to instantiate a python kernel, I think you may want to do soimething similar.

Also notice that if you only need a remote python kernel in C++, then you can just use xeus-python as is.

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

2 participants