Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "cells": [
- {
- "cell_type": "code",
- "execution_count": 10,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "<script>\n",
- " code_shown = true;\n",
- " function code_toggle() {\n",
- " for (let el of document.querySelectorAll('div.input')) el.style.display = code_shown ?'none':'flex';\n",
- " code_shown = !code_shown\n",
- " }\n",
- "</script>\n",
- "<form action=\"javascript:code_toggle()\"><input type=\"submit\" value=\"Toggle\"></form>"
- ],
- "text/plain": [
- "<IPython.core.display.HTML object>"
- ]
- },
- "execution_count": 10,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "from IPython.display import HTML\n",
- "\n",
- "HTML('''<script>\n",
- " code_shown = true;\n",
- " function code_toggle() {\n",
- " for (let el of document.querySelectorAll('div.input')) el.style.display = code_shown ?'none':'flex';\n",
- " code_shown = !code_shown\n",
- " }\n",
- "</script>\n",
- "<form action=\"javascript:code_toggle()\"><input type=\"submit\" value=\"Toggle\"></form>''')"
- ]
- }
- ],
- "metadata": {
- "kernelspec": {
- "display_name": "Python 3",
- "language": "python",
- "name": "python3"
- },
- "language_info": {
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "file_extension": ".py",
- "mimetype": "text/x-python",
- "name": "python",
- "nbconvert_exporter": "python",
- "pygments_lexer": "ipython3",
- "version": "3.6.4"
- }
- },
- "nbformat": 4,
- "nbformat_minor": 2
- }
Add Comment
Please, Sign In to add comment