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

Generate code

Last modified: 03 October 2022

Code | Generate or Alt+Insert

Configure: Ctrl+Alt+S Settings/Preferences | Editor | File and Code Templates

PyCharm provides multiple ways to generate common code constructs and recurring elements, which helps you increase productivity. These can be either file templates used when creating a new file, custom or predefined live templates that are applied differently based on the context, various wrappers, or automatic pairing of characters.

Additionally, PyCharm provides code completion and Emmet support.

From the main menu, select Code | Generate Alt+Insert to open the popup menu with available constructs that you can generate.