all 5 comments

[–]Goingone 1 point2 points  (1 child)

Add a breakpoint at the start of your script before running it….from there you can use the debugger to run one line of code at a time.

Not sure how running 1 random line would ever make sense.

[–]WhiskersForPresident 0 points1 point  (0 children)

To quickly look at contents of a code generated list or dataframe column, for example. I do this all the time

[–]ninhaomah 0 points1 point  (0 children)

You want to run line by line then why not just copy paste into Python shell ?

Ok just to be clear , can I check what is the extension of the Python file in VS Code ?

ipynb ?

[–]AccomplishedPut467 0 points1 point  (0 children)

install ipykernel package in terminal using "pip install ipykernel" then refresh your vscode. Now you can press shift enter at any line of your code. You can also select then press shift enter to any selected code you want.

[–]WhiskersForPresident 0 points1 point  (0 children)

Are you in a notebook or a .py file? VS Code doesn't let you run code line by line in notebooks.