O'Reilly logo

Mastering PyCharm by Quazi Nafiul Islam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Surround templates

Surround templates allow you to take advantage of the Surround With action. An example of an in-built Surround With (Command/Ctrl + T) template is the try / except block:

Surround templates

You can see that there are a few live templates that I can use since I've made them myself. The key to using surround templates is using the SELECTION variable. Here is a simple demonstration:

Surround templates

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required