it seems a better idea is to just use the jupyter_client and develop a new Jupyter DockView in LyX. The jupyter console does not play well with python subprocess.
On Thu, Jun 20, 2019 at 3:27 PM Jason Sun <ds...@cornell.edu> wrote: > I am trying to embed the jupyter console into the current LyX 2.3.2 > branch. It seems doable. There is a jupyter qtconsole but it uses pyqt > which makes it cumbersome to migrate to C++Qt, which LyX uses. So I wanna > spend some time in developing a persistent DockView Widget in which embeds > the jupyter console with the help of pybind11. It might be a long shot, > though. To get it working on Windows might take some doing, but in Linux or > Mac this could be easier. > > On Thu, Jun 20, 2019 at 2:52 PM William Adams <will.ad...@frycomm.com> > wrote: > >> I'd just like to note that I really like this idea, and would really love >> to see it happen --- I tried to use Jupyter Notebook a while back, but got >> bogged down for various reasons, and having its functionalities as a >> stand-alone desktop app which would make nice PDFs would suit my needs >> quite nicely. >> >> On Thu, Jun 20, 2019 at 10:42 AM Jason Sun <ds...@cornell.edu> wrote: >> >>> I thought about this long and hard. It is possible to extend Lyx's >>> functionality beyond the document processer. With the help you pybind 11 >>> and Qt5, I think is it possible to implement some of the IDE features(think >>> RStudio) in LyX. This would be extremely helpful in writing scientific >>> document. Currently, my workflow is to write code in VS Code/Emacs and copy >>> and paste everything back and forth between LyX and code editor. >>> >>> * It is not terribly cumbersome. But if we can development LyX into >>> something like RStudio, it would definitely save some time. >>> >>> * Because LyX has support for knitr. Provided the script editor QtWidget >>> and console Widget has been implemented, it won't be very hard to build a >>> communication mechanism between the IDE portion and the LyX main >>> buffer&main view portion. This is a little bit like Jupyter Console (think >>> IPython), but with much better Latex support. >>> >>> My rough idea: >>> >>> * I think the GUI and UI design part it not so hard. We could just >>> create another ViewSource-like class that inherit DockView but with >>> editable text field. As for console portion, there are quite a few example >>> QtConsole, are we could develop our own wheel. I remember in my undergrad >>> OS class. the first project was to implement a terminal-ish stuff. As far >>> as I am concerned it is not terribly difficult as long as the signals child >>> processes are handled right. >>> >>> * The major work should be in the building a python repl inside LyX. I >>> think LyX has its own Python for some of the scripting procedures, but it >>> is not ideal to use this one. The better solution, IMO, is to enable >>> loading the Python Interpreter the user assigned. This gives a larger >>> flexibility for various reasons (say, some user might want to use >>> TensorFlow. This would be greatly helpful). >>> >>> * with pybind11, it is not really hard to open up a python interpreter >>> inside c++ applications. The developers of pybind11 gave various examples >>> on how to do it. Moreover, pybind11 is a header only library, which makes >>> it easy to be built into other applications. >>> >>> >>> These are my thoughts so far. Would be nice to hear some of your ideas >>> on this. >>> >>> >>> Jason Sun >>> Cornell University >>> >> > > -- > *Daqian Sun* > > *Tel:607-379-5149* > *Department of Mathematics * > *Department of Economics* > *Cornell University* > > -- *Daqian Sun* *Tel:607-379-5149* *Department of Mathematics * *Department of Economics* *Cornell University*