Casey McGuire wrote:
Whil Hentzen (Pro*) wrote:

Not ever even tried to do any Web-oriented stuff with Python, how would you do the typically simple 'form 1 - display text boxes and a form action button', 'form 2 - GET those vars and display the results' type of thing in Python? What's required to be on the server?


For a more PHP/ASP way, we use an Apache module called mod_python.  It
embeds the Python interpreter inside the Apache server.

http://www.modpython.org/

Requirements are Apache, Python, mod_python and a little tweaking to the httpd.conf. I know at least some of the Python web frameworks, use mod_python underneath. Django and CherryPy to name two. We just use mod_python by itself.

Here is some sampe code from a webmail client we did just as a proof of concept type thing. This HTML page is sent one parameter called "boxes". The embedded python code just loops through it and prints
out it's contents


<HTML>

<FORM ACTION="mail_folders_refresh" METHOD="post">

<%
for box in boxes:
    justbox = box.split("(")[0]
    s = """<a id="%s" href="javascript:go_box('%s')">%s</a>
        """ % (justbox, justbox, box)
    s1 = """&nbsp;&nbsp;<a href="javascript:compact_box('%s')">X</a><br>
         """ % (justbox)
    req.write(s+s1)
%>

<TABLE>
  <TR ID="st_getmail" style="display:none;">
    <td>Getting Mail...</TD>
  </TR>
  <TR ID="st_gobox" style="display:none;">
    <td>Going box... :-)</TD>
  </TR>
  <TR ID="rowid">
    <td id="mstatus"><%=status%></td>
  </TR>
</TABLE>
</FORM>
</HTML>


Casey



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to