Many Python programmers switching to Visual Studio Code miss one feature from Scientific Mode in PyCharm or Spyder: the ability to run lines of code one by one from a script and see your output in an IPython console (not just a terminal) — and especially the nice Pandas DataFrame visualizations.
VS Code does not do this out of the box.
Here is exactly what you need to do to get it in 2025.
Prerequisites
You need three official Microsoft extensions. Install these from the Marketplace if you don't have them:
- Python: (Essential language support)
- Jupyter: (Powers the Interactive Window/IPython kernel)
- Data Wrangler: (A DataFrame viewer from Microsoft)
Step 1: The Crucial Setting (Force the Interactive Window)
By default, running a selection in VS Code sends the code to the default Terminal, which is clunky for data exploration. You can force code to run in the Interactive Window (IPython REPL).
- Open Settings (Ctrl + , / Cmd + ,)
- Search for: jupyter.sendSelectionToInteractiveWindow
- Check the box
Now, code that you run will spawn a dedicated Jupyter kernel pane, instead of cluttering your terminal.
Step 2: Map "Alt+Enter" to Run & Advance
You might want Alt+Enter to execute the current line and then automatically move to the next line. To do this, you need to create a custom keybinding.
- Open Keyboard Shortcuts (Ctrl + K, then Ctrl + S).
- Search for this command: Jupyter: Run Selection/Line in Interactive Window.
- Double-click.
- Press Alt + Enter on your keyboard.
- Press Enter to confirm the override.
Step 3: Viewing DataFrames (Data Wrangler)
To visualize dataframes, use Data Wrangler.
- Create a DataFrame (e.g., import pandas as pd...).
- Run the code line by line so the variable is loaded into memory in the Interactive Window.
- At the top of the Interactive Window panel, click the Variables button ({x}).
- Click the "sheet" icon next to your DataFrame variable.
This opens the Data Wrangler view.
Step 4: Fixing the Layout (Side-by-Side)
PyCharm/Spyder typically puts code on the left and variables on the right.
- Run a line of code to open the Interactive Window.
- Click and hold the title tab of the Interactive Window.
- Drag it to the far Right edge of your screen and drop it.
One More: Set Ctrl+B to "Go to Definition"
In PyCharm, Cmd+B (Mac) or Ctrl+B (Windows) jumps to the definition of a variable/function.
To replicate this in VSCode:
- Open Keyboard Shortcuts.
- Unbind the old conflict:
- Search for "Toggle Primary Side Bar Visibility".
- Right-click the entry linked to Cmd+B (or Ctrl+B) and select Remove Keybinding.
- Add the new shortcut:
- Search for "Go to Definition".
- Double-click it and press Cmd+B (or Ctrl+B).
- Press Enter.


