Chapter 8. File Templates and Snippets

 

"Are we there yet?"

 
 --Everyone, including you

Coding is a ton of fun, but sometimes, it can be rather repetitive. Snippets (live templates) in PyCharm help you do away with a lot of the receptive parts. However, PyCharm goes further; it even allows you to make file templates so that once you make a new file, for example, a .py file or a .js file, you can have some boilerplate code written for you. You're already using file templates in PyCharm if you haven't changed its default settings. This chapter is all about coding speed, so hold on to your hats!

In this chapter, we are going to take a look at:

  • File templates
  • Snippets (live templates)
  • Surround templates

File templates

Let's make a new file in PyCharm. The ...

Get Mastering PyCharm now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.