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?
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.
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.
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.
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.
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.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With