code_console.rst 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. .. _code-console:
  2. Code Consoles
  3. =============
  4. Code consoles enable you to run code interactively in a kernel. The cells
  5. of a code console show the order in which code was executed in the
  6. kernel, as opposed to the explicit ordering of cells in a notebook
  7. document. Code consoles also display rich output, just like notebook
  8. cells.
  9. .. _create-console:
  10. Create a new code console by clicking the ``+`` button in the :ref:`file
  11. browser <left-sidebar>` and selecting the kernel:
  12. .. raw:: html
  13. <div class="jp-youtube-video">
  14. <iframe src="https://www.youtube-nocookie.com/embed/7Sb_a6veU1s?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  15. </div>
  16. .. _run-code:
  17. Run code using ``Shift Enter``. Use the up and down arrows to browse the
  18. history of previously-run code:
  19. .. raw:: html
  20. <div class="jp-youtube-video">
  21. <iframe src="https://www.youtube-nocookie.com/embed/L52yh9FPAtY?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  22. </div>
  23. .. _tab-completion:
  24. Tab completion (``Tab``) and tooltips (``Shift Tab``) work as in the
  25. notebook:
  26. .. raw:: html
  27. <div class="jp-youtube-video">
  28. <iframe src="https://www.youtube-nocookie.com/embed/WoqFgmSuigE?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  29. </div>
  30. .. _clear-cell:
  31. Clear the cells of the code console without restarting the kernel by
  32. right-clicking on the code console and selecting “Clear Console Cells”:
  33. .. raw:: html
  34. <div class="jp-youtube-video">
  35. <iframe src="https://www.youtube-nocookie.com/embed/Aj7sQgP39z8?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  36. </div>
  37. .. _log-inspect:
  38. Creating a code console from the :ref:`file menu <menu-bar>` lets you select an existing
  39. kernel for the code console. The code console then acts as a log of
  40. computations in that kernel, and a place you can interactively inspect
  41. and run code in the kernel:
  42. .. raw:: html
  43. <div class="jp-youtube-video">
  44. <iframe src="https://www.youtube-nocookie.com/embed/QyRuPrLrIOs?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  45. </div>