PyCharm
 
Get PyCharm
You are viewing the documentation for an earlier version of PyCharm.

Reusable content in templates

Last modified: 05 September 2023

Include templates are used to define reusable pieces of code (for example, standard headers, copyright statements, and so on) to be inserted in other templates by means of the #parse directives.

The #parse directive has the following syntax:

For example:

Templates that can be referenced in this way in other templates are listed on the Includes tab of the Editor | File and Code Templates page of the IDE settings CtrlAlt0S.

https://resources.jetbrains.com/help/img/idea/2023.2/py_template_include.png
Gif