Differences between revisions 2 and 3
Revision 2 as of 2003-12-30 00:33:55
Size: 1064
Editor: elie
Comment:
Revision 3 as of 2008-11-15 14:00:17
Size: 1066
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 17: Line 17:
or like this ([http://adullact.net/projects/pythml/ PythMl] syntax) or like this ([[http://adullact.net/projects/pythml/|PythMl]] syntax)

PythonInWebPage presentation systems (see PresentationTechnologies) encourages the use of Python source code embedded in the content of a Web page (or other resource to be presented) such that the execution of the code causes the surrounding content to be transformed in some way. A classic, simplified example of this concept using JSP syntax might look like this:

<table>
  <%
  for item in items:
    %>
    <tr>
      <th>Name</th>
      <td><%= item.name %></td>
    </tr>
    <%
  %>
</table>

or like this (PythMl syntax)

<table>
for item in items:
  <tr>
  <th>Name</th>
  <td>`item.name`</td>
  </tr>
</table>

Note that Python's need for indentation raises issues with how code blocks are to be delimited, especially in content which may itself be indented according to a different scheme, hence the use of an empty code block after the body of the loop in the above example.

Comparable technologies include: ASP (Active Server Pages), JSP (JavaServer Pages), PHP.

PythonInWebPage (last edited 2013-02-05 02:01:50 by techtonik)

Unable to edit the page? See the FrontPage for instructions.