PSE templates are the core of any PSE application. They allow developers to separate the application presentation (HTML markup) from the implementation (Python code) in different ways. First, XML processing instructions can be used to embed Python directly in the HTML template. This is very convenient for very rapid application development by someone knowledgable in both Python and HTML. Second, you can replace attribute values of HTML tags with Python expressions or statements. The final way is by using ``Custom Tags'' developed by programmers that completely insulate the HTML designers from the Python code.
It is important to note that while the resulting servlet output is made from the template, the template is actually used to create a Python script that is compiled and stored. The compiled code is then excecuted when a request is made to the web server. This results in fast execution, because the template only has to be processed once and the resulting servlet source compiled once. Templates can even be compiled in advance, ensuring that the user will never experience a syntax error or delay during processing.