Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hotkey in vs code to switch between python interactive window and active editor?

Is there a hotkey ( or a command you can assign one to ) in vs code to switch the cursor between a python interactive window and an active editor widnow?

like image 763
Alex E Avatar asked Dec 10 '19 23:12

Alex E


People also ask

How do I open the Python interactive window in VS Code?

Using the Python Interactive window# To use the window as a console, open it with the Jupyter: Create Interactive Window command from the Command Palette. You can then type in code, using Enter to go to a new line and Shift+Enter to run the code.

How do I open an interactive window in Python?

Open an Interactive window First, switch to the Python Environments window (View > Other Windows > Python Environments or Ctrl+K > Ctrl+`) and select the Open Interactive Window command or button for a chosen environment.

How does the interactive window work in Python?

When you press Enter on a blank line, the Interactive window closes the block and runs it in the interpreter. The Interactive window improves upon the usual Python command-line REPL experience by automatically indenting statements that belong to a surrounding scope.

What is the difference between command line and interactive in Python?

The Interactive window improves upon the usual Python command-line REPL experience by automatically indenting statements that belong to a surrounding scope. Its history (recalled with the up arrow) also provides multiline items, whereas the command-line REPL provides only single lines. The Interactive window also supports several meta-commands.

What is the interactive window in Visual Studio?

The Interactive window (opened with the View > Other Windows > <environment> Interactive menu commands) lets you enter arbitrary Python code and see immediate results. This way of coding helps you learn and experiment with APIs and libraries, and to interactively develop working code to include in your projects.

How do I change the keyboard shortcuts in VS Code?

Advanced customization. All keyboard shortcuts in VS Code can be customized via the keybindings.json file. To configure keyboard shortcuts the way you want, open Keyboard Shortcuts editor and click on {} button on the right of the editor title bar.


2 Answers

CTRL+1 and CTRL+2 will switch between groups. So if you have the interactive window in one group and your code in another, you can uses these shortcuts to switch between them.

like image 87
R Chiodo Avatar answered Oct 23 '22 06:10

R Chiodo


Unfortunately there is no way to switch between those without issues as of now, check these issues: https://github.com/microsoft/vscode/issues/97992 https://github.com/microsoft/vscode-python/pull/12066

like image 29
pkot Avatar answered Oct 23 '22 06:10

pkot