<%@ LANGUAGE = Python %> <% # Utilities import string def render(s): code = string.replace(s, " Response.", "\nResponse.")+"\n" exec code def encode(s): return Server.HTMLEncode(str(s)) def encurl(s): return Server.URLEncode(str(s)) # a lot more goes here, left out for the news group sample class glob: pass # provide easy access to global namespace glob.hello = "Hello from Python" glob.colhead_1 = "column with labels" ncols = 4 nrows = 10 %> Python with ASP

Simple Demo of Python with ASP

Here a calculated string from Python: <%= glob.hello %>

Table generated with Python & ASP, editable with Wysiwyg editor

<% for col in range(1, ncols+1): glob.colno = col render("""%> <%""")%> <% for row in range(1, nrows+1): glob.rowno = row render("""%> <%""") render("""%> <%""") for col in range(1, ncols+1): glob.colno=col render("""%> <%""") render("""%><%""") %>
<% if 0: render("""%>first column header<%""") else: render("""%> <%= glob.colhead_1 %> <% """)%> <%""") if 0: render("""%>other column headers<%""") else: render("""%> <%= "head %d is here" % glob.colno %> <% """) render("""%>
<%""") if 0: render("""%>first column body<%""") else: render("""%> <%= "row %d" % glob.rowno %> <% """) render("""%> <%""") if 0: render("""%>other column bodies<%""") else: render("""%> <%= "row %d col %d" % (glob.rowno, glob.colno) %> <% """) render("""%>

Christian Tismer
Professional Net Service GmbH
email:tismer@pns.cc