{ "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", "There are also [Polyglot Magics](../groovy/PolyglotMagic.ipynb) magics for accessing Python from the JVM.\n", "\n", "You can communicate between languages with [Autotranslation](GeneralAutotranslation.ipynb).\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(\"