Python Forms?

sismex01 at hebmex.com sismex01 at hebmex.com
Thu Oct 10 11:42:49 EDT 2002


> From: grante at visi.com [mailto:grante at visi.com]
> 
> In article <ao1q28$ua0$1 at slb3.atl.mindspring.net>, Nico C. 
> Kalteis wrote:
> 
> > Is there a way to use Python to retrieve variables that are 
> > passed to it by a form without using a CGI script?  In other
> > words, is there something equivalent to the ASP script:
> > 
> ><% localvariable = request("querystring") %>
> > 
> > Any help would be greatly appreciated...
> 
> I know you can use Python as the interpreter in ASP under MS
> IIS, so there surely must be bindings that allow you to access
> various objects containing data like you asked for.
> 
> -- 
> Grant Edwards

That depends on what you're trying to do.

ASPs are the bastard loveless children of mod_perl and cgi
only that on a windows platform.

By the time your ASP is being executed, all input data
(and hence, all query and body parameters) have been read
and parsed; so in effect, you *are* getting more or less
the same thing.

Except in the case of multipart/form-data; it sux that M$
won't help you out with parsing those things; so it's up to
you to parse it, either in VBScript (painful but doable),
or with an external ActiveX or COM object.  Why not in Python?
Because you need to convert those damn "ByteArrays"
into something Python can understand, and at least until
now, I haven't the faintest idea how to do it.

If'n you wanna run ASPs in Python, be sure to use the
directive:

<%@ LANGUAJE=PYTHON %>

at the top; capitalization insensitive.

Also, in "PythonScript" (I believe) there's Request, Response,
Server, and other objects I can't remember right now; they're
the counterparts of the VBScript objects of the same name.

HTH, good luck.

-gustavo













More information about the Python-list mailing list