documents_kernels.rst 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 allows 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. Right-click on a document and select “Create Console for Editor”:
  10. .. raw:: html
  11. <div class="jp-youtube-video">
  12. <iframe src="https://www.youtube-nocookie.com/embed/JS2mhCD3rwE?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  13. </div>
  14. Once the code console is open, send a single line of code or select a
  15. block of code and send it to the code console by hitting
  16. ``Shift Enter``:
  17. .. raw:: html
  18. <div class="jp-youtube-video">
  19. <iframe src="https://www.youtube-nocookie.com/embed/ODevllc9PXw?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  20. </div>
  21. In a Markdown document, ``Shift Enter`` will automatically detect if the
  22. cursor is within a code block, and run the entire block if there is no
  23. selection:
  24. .. raw:: html
  25. <div class="jp-youtube-video">
  26. <iframe src="https://www.youtube-nocookie.com/embed/Kz3e7SgqTnI?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  27. </div>
  28. *Any* text file (Markdown, Python, R, LaTeX, C++, etc.) in a text file
  29. editor can be connected to a code console and kernel in this manner.