-1

I am currently transitioning from using Jupyter notebooks to .py files, and I want to to able to execute certain lines of code in my program interactively

I know that if I

(1) select the block of code -> right-click -> Run in Interactive Windows -> Run Selection/Line in Interactive Window,

then I can run the code in the kernel that I define (mapping it to conda env, e.g. "my_env").

When I try to do supposedly the same steps:

(2) select the block of code -> shift + enter,

VS Code opens a new interactive window with "Python REPL" kernel.

Is there a way to use the shortcut (2) for running the code in the predefined kernel (i.e. "my_env" kernel)?

I can run things in interactive mode when using the (1), but it doesn't make sense to right-click all the time.

1
  • Is your problem solved? Commented Mar 28 at 9:54

1 Answer 1

0

Settings

"jupyter.interactiveWindow.textEditor.executeSelection": true

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.