0

When using with JavaScript, clicking the Run icon simply runs the code. But under Python, when clicking the button, instead of directly running the code it opens an option menu to choose: 1. Run Code, 2. Run Python file in terminal. Is there a way to set the extension to simply run the code as it does with JavaScript? Thanx.

DLord
  • 3
  • 2

1 Answers1

0

The reason is that in VS Code, the "Python" extension provides a "Run Python File in Terminal" run button, and the "Code Runner" extension provides a "Run Code" run button, and now these two buttons are integrated together , Which provides users with the option of running python.

If you don't want to click the run button twice, you could click F5 to debug python or turn off the "Code Runner" extension when running python code.

enter image description here

Jill Cheng
  • 9,179
  • 1
  • 20
  • 25
  • At the moment I am turning off the extension when running python code. But have to toggle on and off every time I switch between Python and JavaScript. That is why I'm asking for a workaround. – DLord May 11 '21 at 10:20
  • @DLord -There is currently no direct way to make VS Code only display the "Run Code" button when using the "Python" extension and the "Code Runner" extension at the same time. – Jill Cheng May 12 '21 at 01:17
  • Thanx for the reply. It's a pity that developers of code-runner have not taking any action, considering so many requests in this regard. – DLord May 12 '21 at 08:32