Guest User

Untitled

a guest
Apr 25th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. {
  2. "cells": [
  3. {
  4. "cell_type": "code",
  5. "execution_count": 10,
  6. "metadata": {},
  7. "outputs": [
  8. {
  9. "data": {
  10. "text/html": [
  11. "<script>\n",
  12. " code_shown = true;\n",
  13. " function code_toggle() {\n",
  14. " for (let el of document.querySelectorAll('div.input')) el.style.display = code_shown ?'none':'flex';\n",
  15. " code_shown = !code_shown\n",
  16. " }\n",
  17. "</script>\n",
  18. "<form action=\"javascript:code_toggle()\"><input type=\"submit\" value=\"Toggle\"></form>"
  19. ],
  20. "text/plain": [
  21. "<IPython.core.display.HTML object>"
  22. ]
  23. },
  24. "execution_count": 10,
  25. "metadata": {},
  26. "output_type": "execute_result"
  27. }
  28. ],
  29. "source": [
  30. "from IPython.display import HTML\n",
  31. "\n",
  32. "HTML('''<script>\n",
  33. " code_shown = true;\n",
  34. " function code_toggle() {\n",
  35. " for (let el of document.querySelectorAll('div.input')) el.style.display = code_shown ?'none':'flex';\n",
  36. " code_shown = !code_shown\n",
  37. " }\n",
  38. "</script>\n",
  39. "<form action=\"javascript:code_toggle()\"><input type=\"submit\" value=\"Toggle\"></form>''')"
  40. ]
  41. }
  42. ],
  43. "metadata": {
  44. "kernelspec": {
  45. "display_name": "Python 3",
  46. "language": "python",
  47. "name": "python3"
  48. },
  49. "language_info": {
  50. "codemirror_mode": {
  51. "name": "ipython",
  52. "version": 3
  53. },
  54. "file_extension": ".py",
  55. "mimetype": "text/x-python",
  56. "name": "python",
  57. "nbconvert_exporter": "python",
  58. "pygments_lexer": "ipython3",
  59. "version": "3.6.4"
  60. }
  61. },
  62. "nbformat": 4,
  63. "nbformat_minor": 2
  64. }
Add Comment
Please, Sign In to add comment