I just made the transition from Spyder to VScode for my python endeavours. Is there a way to run individual lines of code? That's how I used to do my on-the-spot debugging, but I can't find an option for it in VScode and really don't want to keep setting and removing breakpoints.
Thanks.
Users can right-click the text editor and then select “Run Code” in the context menu. With only two clicks, your code will run. “Run Code” is also an option in the editor title menu and the file explorer's context menu.
You can also run VS Code from the terminal by typing 'code' after adding it to the path: Launch VS Code. Open the Command Palette (Cmd+Shift+P) and type 'shell command' to find the Shell Command: Install 'code' command in PATH command.
If you highlight some code, you can right-click or run the command, Run Selection/Line in Python Terminal
.
We are also planning on implementing Ctrl-Enter to do the same thing and looking at Ctr-Enter executing the current line.
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