{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Magics to Access the JVM Kernels from Python\n", "\n", "BeakerX has magics for Python so you can run cells in the other languages.\n", "The first few cells below show how complete the implementation is with Groovy, then we have just one cell in each other language.\n", "\n", "Fleshing out the polyglot support in BeakerX with communication between languages ([#5039](https://github.com/twosigma/beakerx/issues/5039)) and the ability to access Python from the JVM kernels ([#6279](https://github.com/twosigma/beakerx/issues/6279)) are on the agenda.\n", "\n", "## Groovy" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%%groovy\n", "println(\"stdout works\")\n", "f = {it + \" work\"}\n", "f(\"results\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%%groovy\n", "new Plot(title:\"plots work\", initHeight: 200)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%%groovy\n", "[a:\"tables\", b:\"work\"]" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%%groovy\n", "\"errors work\"/1" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%%groovy\n", "HTML(\"