Run Python With An Interactive Window In Visual Studio Code / Cursor / Kiro

Enable Jupyter interactive window in VSCode for Python code execution. Install Jupyter, write code, press Shift + Enter. In settings, enable "Jupyter > Interactive Window > Text Editor: Execute Selection". Restart VSCode if needed. This allows partial code execution and variable inspection, improving workflow efficiency.

In Visual Studio Code(VSCode) or its forked projects, like Cursor and Kiro, the output will appear in the terminal by default when you run Python code (using Shift + Enter). The operation runs the whole script and is inconvenient because you can’t run a part of the code and inspect variables.

This post will show you how to run Python in a Jupyter interactive window. You can also follow the cheat sheet below.

First, you need to install the Jupyter extension.

Then turn on the setting in the preferences

Step-by-Step Tutorial

Here are the detailed steps. (Please note that the steps in the image start from step 0, and the steps below start from 1.)

  1. Install Jupyter extension
  2. Install Jupyter library using `pip install jupyter`
  3. You can write some simple code and press Shift + Enter
  4. By default, the output shows in the terminal.
  5. Open settings and search “jupyter interactive send select”
  6. Find the “Jupyter > Interactive Window > Text Editor: Execute Selection” option and enable it.
  7. When pressing Shift + Enter again, the code will be sent to the Jupyter interactive window. If not, you can try to restart VSCode.

🚀 Unlock Ads-Free Experience At $5/year

✓ 14 days free trial ✓ Cancel anytime

18 thoughts on “Run Python With An Interactive Window In Visual Studio Code / Cursor / Kiro”

  1. Your is a treasure trove of practical information! I especially enjoyed this post—it’s clear you know your stuff. Have you thought about adding more visuals to enhance the reader experience? Great job! 의왕출장샵

  2. Saint Denis (17-3 MMA) aims to use his high-level grappling to stall the momentum of Pimblett (23-4 MMA), who enters the fight seeking the highest- ranked victory of his UFC career thus far. 광양출장샵

Leave a Comment

Your email address will not be published. Required fields are marked *