IDLE Templates
Home Up

 

This plug-in lets you type the first few letters of a template and hit ALT-J to extract a code snippet.  Author: Joao Nuno Carvalho

Smart Templates is a macro expansion tool. Currently it expands macros that are defined in the SmartTemplates.py file, with proper indentation in the case of multi-line macros. The developer can jump
rapidly between ? Cursor marks in the macros with Alt+ h. It support jumps in nested expansions and selected text expansions. 

Animated Example of Usage:

In the above animation, the user types in ifn then presses ALT-J.  Once the template text is inserted, he/she jumps between the ? marks using ALT-H.

Installation

1. Edit your c:\python22\Tools\idle\config-win.txt (or config-unix.txt if you are running unix/linux) and add the following entry

[SmartTemplates]

2. Put SmartTemplates.py into your  c:\python22\Lib\site-packages directory.

3. Restart idle.

Comments and Links

To add your own templates, you need to edit the file SmartTemplates.py itself.

Other IDLE plug-ins.