Skip to content

Latest commit

 

History

History
20 lines (10 loc) · 1.54 KB

polyglot.md

File metadata and controls

20 lines (10 loc) · 1.54 KB

Multi-language notebooks

With .NET Interactive you can create notebooks that use different languages together. A notebook has a default language. Any cell whose language isn't set specifically will use the default language. In JupyterLab, the default language is chosen when you create a new notebook:

When a notebook is opened in JupyterLab, its default language is displayed in the upper right corner. In this example, the default language is C#:

But every .NET Interactive notebook is capable of running multiple languages. You can specify the language for a cell using one of a number of magic commands. For example, though the default language of the following notebook is F#, it's possible to run code in C# using the #!csharp magic command and in PowerShell using the #!pwsh magic command:

If you're editing a notebook in Visual Studio Code, you can also choose the language for a submission by clicking the language selector in a cell's lower right corner.

The language-selection magic commands will still work in Visual Studio Code as well.