elksie5000
elksie5000

Reputation: 7772

What is VSCode setting to send output from code executed to interactive window instead of terminal?

looking to move away from Jupyter Notebook and seen interactive window in VSCode. However selecting code and then pressing shift+enter sends execution output to terminal, not interactive window.

Added code to keyboard shortcuts:

{
            "key": "shift+enter",
            "command": "python.execSelectionInteractive",
            "when": "editorTextFocus && editorLangId == 'python'"
}

But that didn't work. Output still in terminal. What do I need to do?

Upvotes: 0

Views: 30

Answers (1)

elksie5000
elksie5000

Reputation: 7772

Ah. https://www.youtube.com/watch?v=F60iJ3xxgtg

Add

# %%

And there you go. Interactive code like Jupyter Notebook in script. Nice.

Upvotes: 0

Related Questions