Adam R. B. Jack wrote:

Beyond those two the next biggest hurdle is the markup that is produced.
 If that is relatively straightforward (in other words, uses techniques
like CSS instead of things like spacer gifs and nested tables), then
building CGIs is downright trivial.

I know Leo has found some ways to build WWW applications in Python that he is interested in. I would hope his efforts, and these, could share at some level. Perhaps share a Python webapp framework (if one is picked), but there is no real need for this to be the case since you are talking simple CGIs. [When you say CGI I'm reading good old fashioned "common gateway interface", right?] I guess sharing could just be a WWW server (with auth) and a simple webapp space/look-and-feel.

Framework? We don't need to steenken framework. Take a peek at:


http://brutus.apache.org/gump/public/test.cgi?foo=bar

Anything you can do from python can be done via CGI. Anything.

Below is the source. Note output is declared as text/plain, but text/html, or even application/atom+xml are possible.

I did say "downright trivial".

- Sam Ruby

-----------------------------------------

#!/usr/bin/python
print "Content-Type: text/plain\r\n\r\n";

import cgi, os, sys
print sys.stdin.readline()

fs = cgi.FieldStorage()
print 'type\t',fs.type
print 'headers\t',fs.headers
print 'path\t',os.path.realpath('.')

print
for arg in fs.list:
  print arg.name, arg.value

print
for (key,value) in  os.environ.items():
  print key, value.strip()

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to