Snippets (live templates)

Live templates are a wonderful part of PyCharm. They are very helpful when there is a repetitive pattern that you need to type over and over again. PyCharm 3.4 introduced a couple of new snippets into the mix, so let's see how we can make our own by inspecting the snippets that are already available. Let's take a look at the main snippet that comes bundled with PyCharm 3.4:

Snippets (live templates)

We can see that [1] is the snippet in question and it has its own abbreviation main, and this is what we invoke with [2]. The description for snippet [3] is what will be shown when you try to invoke Insert Live Template (Command/Ctrl + J). You can change ...

Get Mastering PyCharm now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.