documents_kernels.rst 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. .. _kernel-backed-documents:
  2. Documents and Kernels
  3. =====================
  4. In the Jupyter architecture, kernels are separate processes started by
  5. the server that run your code in different programming languages and
  6. environments. JupyterLab enables you to connect any open text file to a
  7. :ref:`code console and kernel <code-console>`. This means you can easily run code from the
  8. text file in the kernel interactively.
  9. .. _create-console:
  10. Right-click on a document and select “Create Console for Editor”:
  11. .. raw:: html
  12. <div class="jp-youtube-video">
  13. <iframe src="https://www.youtube-nocookie.com/embed/JS2mhCD3rwE?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  14. </div>
  15. .. _send-code:
  16. Once the code console is open, send a single line of code or select a
  17. block of code and send it to the code console by hitting
  18. ``Shift Enter``:
  19. .. raw:: html
  20. <div class="jp-youtube-video">
  21. <iframe src="https://www.youtube-nocookie.com/embed/ODevllc9PXw?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  22. </div>
  23. .. _run-markdown:
  24. In a Markdown document, ``Shift Enter`` will automatically detect if the
  25. cursor is within a code block, and run the entire block if there is no
  26. selection:
  27. .. raw:: html
  28. <div class="jp-youtube-video">
  29. <iframe src="https://www.youtube-nocookie.com/embed/Kz3e7SgqTnI?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  30. </div>
  31. *Any* text file (Markdown, Python, R, LaTeX, C++, etc.) in a text file
  32. editor can be connected to a code console and kernel in this manner.