MacOS – How to use Spyder keyboard shortcuts with Mac OS

keyboardmacospythonshortcut

I'm using the Spyder IDE to do Python development on macOS. This IDE provides some keyboard shortcuts I'm used to from other platforms, especially

  • F9 for running a line or selection of lines of codes.
  • F5 for running an entire Python script.

Unfortunately they don't seem to work. I found a suggestion to reset the shortcuts within the application by going to Preferences -> keyboard shortcut and restore the defaults. That didn't work for me, so how can I make these shortcuts work?

Best Answer

nohillside gave me a good hint and deserves credit for this answer. On a Mac when using F functions shortcuts where two different items are on that key, you have to use the "fn" key first at the left-hand bottom of your Apple keyboard. If the the F function key has only one item, then you can use it directly without the "fn" in front.

Thus, on my own Apple keyboard (and I suspect yours is the same), you don't have to hit fn before F5 or F6. But, you have to use fn in front of all the others.

Attempting to resolve this issue through the Preference -> Keyboard path just did not work at all for me, no matter what I tried. And, I tried a lot of different things.

nohillside had uncovered another way to attempt to resolve this issue from a GitHub reference. It seemed incredibly complicated and very invasive suggesting you modify numerous of your Python packages. That seemed somewhat dangerous. And, I am just sticking to the fn solution when typing F9. That's easy enough, and not that tasking.