Reputation: 8439
I use VS Code on a Mac laptop. If I'm using Python I can run the code by pressing the little arrow in the top right,
However, I can't seem to find a keyboard shortcut for this. There is an old question, How to execute Python code from within Visual Studio Code, but all the answers there seem either to be obsolete or not to work on a Mac. One of them says that the F5 key should work, but my Mac has a useless touchbar instead of function keys so it's no help to me.
tl;dr is there a shortcut to run Python code on a modern VS Code installation besides F5, or an easy way to set one up?
Upvotes: 6
Views: 9353
Reputation: 43
You can try with ctrl+shift+b
in windows or ⌘+shift+b
in MacOS.
Upvotes: 0
Reputation: 9521
I'm using Windows so i can't give you a specific answer. But Code > Preferences > Keyboard Shortcuts, search with keyword run python file
, you will get related shortcuts.
Upvotes: 6