Could you say more about what you want to accomplish? Numpy and Sympy are toolkits which are used by other programs. You can write Python programs in Leo, run them, and display the results in several ways, if that's what you are thinking. You can use Mathjax to make good-looking equations.
One way to do this is to take advantage of the Viewrendered3 plugin. You can mix text and program fragments somewhat as you can with Jupyter (Jupyter can do a lot more, but VR3 can be much more convenient especially for Leo users). I've attached a small example of a notebook. It uses numpy to create some data, plots the data, and then for good measure renders an equation. You will probably need to create some settings nodes to myLeoSettings for Mathjax to render the equation. Directions are in the documentation for the VR3 plugin. In VR3, make sure to check the *Entire Tree* view option before executing the notebook. If you don't know how to find the documentation, add new settings, or enable the plugin, just ask here. On Friday, August 6, 2021 at 10:03:09 AM UTC-4 [email protected] wrote: > I don't know how much of a tall order this is, but are they implementable > into leo? -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/01963160-b421-41b9-affc-bf3d1f382a8dn%40googlegroups.com.
<?xml version="1.0" encoding="utf-8"?> <!-- Created by Leo: http://leoeditor.com/leo_toc.html --> <leo_file xmlns:leo="http://leoeditor.com/namespaces/leo-python-editor/1.1" > <leo_header file_format="2"/> <vnodes> <v t="TomP.20170108000351.1"><vh>Example Notebook</vh> <v t="TomP.20170108000351.2"><vh>Make a 'data' array and print the means.</vh></v> <v t="TomP.20170108000351.3"><vh>Now lets plot that 'data' array.</vh></v> <v t="TomP.20170108000351.4"><vh>and see the plot ...</vh></v> <v t="TomP.20170108195857.1"><vh>and see a formula...</vh></v> </v> </vnodes> <tnodes> <t tx="TomP.20170108000351.1">@language rest This node tree shows the "notebook"-style operation of VR3. With the *Entire Tree* switched-on in the Options, When the *Execute* button is clicked, code blocks in the tree are executed and the text output shown. Charts are a tiny bit more clumsy, requiring saving the chart to a file and including the image file using the usual ``.. image::`` directive in reST. </t> <t tx="TomP.20170108000351.2">@language python import numpy data = numpy.random.randn(30, 3) print('The means of the columns are:', numpy.mean(data[:10,:], axis=0)) </t> <t tx="TomP.20170108000351.3">@language python from matplotlib import pyplot pyplot.plot(data) pyplot.savefig('VR3testplot.png', dpi=50) </t> <t tx="TomP.20170108000351.4"> .. image:: VR3testplot.png </t> <t tx="TomP.20170108195857.1">@language rest .. math:: \sum_{n=1}^\infty\frac{-e^{i\pi}}{2^n}+(\frac{5-\frac{1}{x}}{4}) </t> </tnodes> </leo_file>
