diff --git a/docs/languages/images/python/native-jupyter.png b/docs/languages/images/python/native-jupyter.png index 87d8cc8195..b6c95cb0d2 100644 --- a/docs/languages/images/python/native-jupyter.png +++ b/docs/languages/images/python/native-jupyter.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1affee107f33ebd83ea6279346c0e59c88f950b7f6cb12dad3c69d6374a78ee5 -size 55427 +oid sha256:1e83ab0378dc74745a438ecc02bbde9aa22af29e7b71d14a454db9ada21f604f +size 312047 diff --git a/docs/languages/python.md b/docs/languages/python.md index 741eadd7fc..ff28186917 100644 --- a/docs/languages/python.md +++ b/docs/languages/python.md @@ -19,7 +19,7 @@ This article provides only an overview of the different capabilities of the Pyth The [tutorial](/docs/python/python-tutorial.md) guides you through installing Python and using the extension. You must install a Python interpreter yourself separately from the extension. For a quick install, use [Python from python.org](https://www.python.org/downloads/) and [install the extension from the VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=ms-python.python). -Once you have a version of Python installed, activate it using the **Python: Select Interpreter** command. If VS Code doesn't automatically locate the interpreter you're looking for, refer to [Environments - Manually specify an interpreter](/docs/python/environments.md#manually-specify-an-interpreter). +Once you have a version of Python installed, select it using the **Python: Select Interpreter** command. If VS Code doesn't automatically locate the interpreter you're looking for, refer to [Environments - Manually specify an interpreter](/docs/python/environments.md#manually-specify-an-interpreter). You can configure the Python extension through settings. Learn more in the [Python Settings reference](/docs/python/settings-reference.md). @@ -108,17 +108,15 @@ Packages are installed using the **Terminal** panel and commands like `pip insta ## Jupyter notebooks -If you open a [Jupyter notebook](https://jupyter.org/) file (`.ipynb`) in VS Code, you can use the Jupyter Notebook Editor to directly view, modify, and run code cells. +To enable Python support for [Jupyter notebook](https://jupyter.org/) files (`.ipynb`) in VS Code, you can install the [Jupyter extension](https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter). The Python and the Jupyter extensions work together to give you a great Notebook experience in VS Code, providing you the ability to directly view and modify code cells with IntelliSense support, as well as run and debug them. ![Jupyter notebook running in VS code in the Notebook Editor](images/python/native-jupyter.png) -You can also convert and open the notebook as a Python code file. The notebook's cells are delimited in the Python file with `#%%` comments, and the Python extension shows **Run Cell** or **Run All Cells** CodeLens. Selecting either CodeLens starts the Jupyter server and runs the cell(s) in the Python interactive window: +You can also convert and open the notebook as a Python code file through the **Jupyter: Export to Python Script** command. The notebook's cells are delimited in the Python file with `#%%` comments, and the Jupyter extension shows **Run Cell** or **Run Below** CodeLens. Selecting either CodeLens starts the Jupyter server and runs the cell(s) in the Python interactive window: ![Jupyter notebook running in VS Code and the Python interactive window](images/python/jupyter.png) -Opening a notebook as a Python file allows you to use all of VS Code's debugging capabilities. You can then save the notebook file and open it again as a notebook in the Notebook Editor, Jupyter, or even upload it to a service like [Azure Notebooks](https://learn.microsoft.com/azure/notebooks). - -Using either method, Notebook Editor or a Python file, you can also connect to a remote Jupyter server for running the code. For more information, see [Jupyter support](/docs/datascience/jupyter-notebooks.md). +You can also connect to a remote Jupyter server to run your notebooks. For more information, see [Jupyter support](/docs/datascience/jupyter-notebooks.md). ## Testing diff --git a/docs/python/tutorial-flask.md b/docs/python/tutorial-flask.md index 796ec7ea23..878ac77e54 100644 --- a/docs/python/tutorial-flask.md +++ b/docs/python/tutorial-flask.md @@ -111,7 +111,7 @@ You now have a self-contained environment ready for writing Flask code. VS Code 1. Stop the app by using `kbstyle(Ctrl+C)` in the terminal. -> **Tip**: If you want to use a different filename than `app.py`, such as `program.py`, define an environment variable named FLASK_APP and set its value to your chosen file. Flask's development server then uses the value of FLASK_APP instead of the default file `app.py`. For more information, see [Flask command line interface](https://flask.palletsprojects.com/en/1.1.x/cli/). +> **Tip**: When using a different filename than `app.py`, such as `webapp.py`, you will need to define an environment variable named FLASK_APP and set its value to your chosen file. Flask's development server then uses the value of FLASK_APP instead of the default file `app.py`. For more information, see [Flask command line interface](https://flask.palletsprojects.com/en/1.1.x/cli/). ## Run the app in the debugger @@ -634,7 +634,7 @@ Throughout this Flask tutorial, all the app code is contained in a single `app.p ![Flask tutorial: modified project structure with separate files and folders for parts of the app](images/flask-tutorial/project-structure.png) 1. Run the app in the debugger again to make sure everything works. To run the app outside of the VS Code debugger, use the following steps from a terminal: - 1. Set an environment variable for `FLASK_APP`. On Linux and macOS, use `export set FLASK_APP=webapp`; on Windows use `set FLASK_APP=webapp`. + 1. Set an environment variable for `FLASK_APP`. On Linux and macOS, use `export set FLASK_APP=webapp`; on Windows use `$env:FLASK_APP=webapp` if you're using PowerShell, or `set FLASK_APP=webapp` if you're using Command Prompt. 1. Navigate into the `hello_app` folder, then launch the program using `python -m flask run`. ### Create a container for a Flask app using the Docker extension