Key shortcut for running python file in VS code

Question:

In VS Code, I’m writing python code. I was wondering if there is a key shortcut to run the file instead of pressing the run button in the right top corner of the screen constantly.

Asked By: erwindenboer

||

Answers:

You can press Ctrl + F5 to run the file.

If you want to debug the file, use F5 instead.

Answered By: cycool29

You can refer to the picture below to find the shortcut key and change it according to your needs.

enter image description here

enter image description here

Answered By: MingJie-MSFT

For anyone googling, this was my approach that has worked rather well

CTRLK + CTRLS brings the Keyboard Shortcuts menu.

keyboard shortcuts

At the top, in the search bar, type run python file.

enter image description here

From there, you can add a keybind to the Run Python File tag.

Answered By: Nolan Pestano