xeus-cling icon indicating copy to clipboard operation
xeus-cling copied to clipboard

%cpp magic inside Python notebook

Open pushnyakov opened this issue 6 years ago • 8 comments

Is it possible to use c++ inside a Python kernel? Something like https://root.cern.ch/notebooks/HowTos/HowTo_ROOT-Notebooks.html#python

pushnyakov avatar Dec 05 '18 18:12 pushnyakov

I think that it would be an interesting feature. I don't think that it would be too hard to do.

SylvainCorlay avatar Dec 22 '18 13:12 SylvainCorlay

Or, conversely, would it be possible to use %%python in a notebook with C++ (cling) kernel?

tadeu avatar Jan 25 '19 12:01 tadeu

Any update on the development state of this feature?

mujina93 avatar Jul 03 '20 16:07 mujina93

I want to work on this feature but really have no idea where to start. Any pointers?

PS - Am currently poking around trying to figure out where to start.

rangerscience avatar Oct 18 '20 20:10 rangerscience

I think you can use allthekernels. It's not really a magic, but the result is quite the same: you can execute C++ code in a Notebook where cells are considered as Python code by default.

JohanMabille avatar Oct 19 '20 05:10 JohanMabille

AllTheKernels works with Xues, and python/ruby/javascript, but doesn't appear to work with BeakerX (for the whole JVM family). Thanks for the tip, to!

I do want to at least try to work this into XC, but I'm not even sure where to start in on reading the code here. Can anyone give me a brief developer's overview?

rangerscience avatar Oct 20 '20 00:10 rangerscience

@JohanMabille @tadeu @rangerscience I am unable to run python code in the cell using %%python I have followed all the steps given in readme of repo can you guide me out.

kshitijdshah99 avatar Feb 21 '24 17:02 kshitijdshah99

My c++ code is working all well in the jupyter file but in the same file my python code is not running do you have any good resources?

kshitijdshah99 avatar Feb 21 '24 17:02 kshitijdshah99