I am guessing you want to know how to do this in PyCharm. In PyCharm Community Edition 2021.2, File>Settings>Keymap> type 'execute' in search bar. I am using Ctlr+Enter.

image.pngimage.png