Pycharm has a Live Template feature that allows you to specify shortcuts that expand to code of your choice:
Expansion happens by pressing the tab key though, not on its own.
The only once I ever use is the main
one (because if __name__ == '__main__':
is a pain to type), so I don’t have a lot of experience with them. They’ve worked well the few times I’ve used them though.
CLICK HERE to find out more related problems solutions.