Python equivalent of Perl-ISAPI?

R

rurpy

Is there an effcient way (more so than cgi) of using Python
with Microsoft IIS? Something equivalent to Perl-ISAPI?
 
R

Roger Upole

Is there an effcient way (more so than cgi) of using Python
with Microsoft IIS? Something equivalent to Perl-ISAPI?

Pywin32 comes with an ISAPI package. See
\lib\site-packages\isapi\samples\
for some demos.

Roger
 
R

rurpy

Waldemar said:

Thanks for your and Roger's responses.

I looked at pyisapie and there seems to be almost no
dvcumentation -- no sample code and the single readme
is pretty opaque. The pywin isapi has a couple of
examples but its documentation too is pretty bad.
But they both seem to be tissue thin wtrappers around
the MS isapi api. What I was hoping for is something
that would let me run existing cgi scripts efficiently with
minimal changes. I think the isapi and perl-ex stuff that
comes with Activestate's Perl meets this requirement
but the stuff I've found for Python doesn't. So looks
like it's back to Perl for this project :-(.
 
S

Steve Holden

Thanks for your and Roger's responses.

I looked at pyisapie and there seems to be almost no
dvcumentation -- no sample code and the single readme
is pretty opaque. The pywin isapi has a couple of
examples but its documentation too is pretty bad.
But they both seem to be tissue thin wtrappers around
the MS isapi api. What I was hoping for is something
that would let me run existing cgi scripts efficiently with
minimal changes. I think the isapi and perl-ex stuff that
comes with Activestate's Perl meets this requirement
but the stuff I've found for Python doesn't. So looks
like it's back to Perl for this project :-(.
If you want CGI then there's no need for an ISAPI filter specific to
your programming language - you just need to associate .py requests with
the Python interpreter.

If you want to use Python as an Active Scripting language (i.e. in the
same way that VBScript is used) then you can do this by installing the
win32all extensions maintained by Mark Hammond and enabling Active
Scripting therein.

Don't suffer Perl if you don't want to!

regards
Steve
 
R

rurpy

Steve said:
If you want CGI then there's no need for an ISAPI filter specific to
your programming language - you just need to associate .py requests with
the Python interpreter.

If you want to use Python as an Active Scripting language (i.e. in the
same way that VBScript is used) then you can do this by installing the
win32all extensions maintained by Mark Hammond and enabling Active
Scripting therein.

Don't suffer Perl if you don't want to!

Pure cgi is too slow. "Active Scripting" means ASP, yes?
I need something that will do cgi scripts (a lot of which I already
have
and can modify but don't want to rewrite extensively, partly because
of time issues, partly because I want to preserve some degree of
portability back to a unix environment.). I want something that does
for IIS what mod_python does for apache. Fastcgi looked scary even
on unix plaforms, seems like an act of desperation on Windows,
 
S

Steve Holden

Pure cgi is too slow. "Active Scripting" means ASP, yes?
I need something that will do cgi scripts (a lot of which I already
have
and can modify but don't want to rewrite extensively, partly because
of time issues, partly because I want to preserve some degree of
portability back to a unix environment.). I want something that does
for IIS what mod_python does for apache. Fastcgi looked scary even
on unix plaforms, seems like an act of desperation on Windows,
Yes, ASP is Active Scripting.

Remember to use <@ LANGUAGE="PYTHON" @>

regards
Steve
 
R

rurpy

Steve said:
(e-mail address removed) wrote:
Yes, ASP is Active Scripting.

Remember to use <@ LANGUAGE="PYTHON" @>

Except I need cgi, not asp, for the reasons i gave.
 
A

Atanas Banov

Except I need cgi, not asp, for the reasons i gave.

it seems to me you have no clear idea what you need.

you say you have a lot of CGIs written but you don't clarify if that is
Python or Perl. since you look for python intergration, it seems they
are in python, however in previous posting you say you'll have to
revert to Perl for solution. it just doesnt make sense! if you use
Perl, you will have to REWRITE the scripts and if you do so, it's
unclear why wouldnt you use a superior technology like PHP/ASP/JSP -
any of those is way easier to manage.

it's also unclear why don't you use apache on windows, if mod_python is
your poison.

here is how i imagine you have the layers:
[scripts (CGI?)]
[glue]
[web server (IIS?)]

where the discussion is about the "glue" between them. you say CGI is
too slow for you, so you will want something maintaining the CGI
programming model, but faster. this thing is called FastCGI - but you
are unhappy about it either. there is no way any perl "glue" can solve
your problem between your web server and your python scripts
whatsoever. you'll have to re-code the scripts for perl.
 
R

rurpy

Atanas said:
Except I need cgi, not asp, for the reasons i gave.

it seems to me you have no clear idea what you need.

you say you have a lot of CGIs written but you don't clarify if that is
Python or Perl. since you look for python intergration, it seems they
are in python, however in previous posting you say you'll have to
revert to Perl for solution. it just doesnt make sense! if you use
Perl, you will have to REWRITE the scripts and if you do so, it's
unclear why wouldnt you use a superior technology like PHP/ASP/JSP -
any of those is way easier to manage.

it's also unclear why don't you use apache on windows, if mod_python is
your poison.

here is how i imagine you have the layers:
[scripts (CGI?)]
[glue]
[web server (IIS?)]

where the discussion is about the "glue" between them. you say CGI is
too slow for you, so you will want something maintaining the CGI
programming model, but faster. this thing is called FastCGI - but you
are unhappy about it either. there is no way any perl "glue" can solve
your problem between your web server and your python scripts
whatsoever. you'll have to re-code the scripts for perl.

The final solution must run in a Windows/IIS environment.
Those are part of the requirements which I do not control.
There is code in both Perl and Python. I wrote the Python
stuff and inherited the Perl stuff. It is not web-based now
but conversion to generate html output instead of text is
probably straightforward. Additional requirement is that
is should be movable to unix without too much work.
The layers are:

[database] [equipment interface]
[glue]
[cgi]
[webserver - IIS]

As fo PHP/ASP/JSP? I am doing all the work. I know Perl
and Python. I don't know PHP/JSP. (Also, JSP will require
a lot of new Java infrastructure support, yes?) As for ASP,
I wonder about the "easily moved to unix" requirement.
(I know apache has an asp module but I don't know if other
web servers do, or how compatible apache's is, and I don't
know if I have time to reliably answer those questions.)
Why do you say PHP/JSP/ASP are superior technologies?

All I want to do is avoid the cost of starting a new Python
(or Perl) interpreter on each page request. This is what
I understand Perl-isapi and Perl-Ex does. My question
is simply if there is something similar for Python.
I have concluded the answer is no but hope I'm wrong.
 
R

rurpy

Atanas said:
Except I need cgi, not asp, for the reasons i gave.

it seems to me you have no clear idea what you need.

you say you have a lot of CGIs written but you don't clarify if that is
Python or Perl. since you look for python intergration, it seems they
are in python, however in previous posting you say you'll have to
revert to Perl for solution. it just doesnt make sense! if you use
Perl, you will have to REWRITE the scripts and if you do so, it's
unclear why wouldnt you use a superior technology like PHP/ASP/JSP -
any of those is way easier to manage.

it's also unclear why don't you use apache on windows, if mod_python is
your poison.

here is how i imagine you have the layers:
[scripts (CGI?)]
[glue]
[web server (IIS?)]

where the discussion is about the "glue" between them. you say CGI is
too slow for you, so you will want something maintaining the CGI
programming model, but faster. this thing is called FastCGI - but you
are unhappy about it either. there is no way any perl "glue" can solve
your problem between your web server and your python scripts
whatsoever. you'll have to re-code the scripts for perl.

The final solution must run in a Windows/IIS environment.
Those are part of the requirements which I do not control.
There is code in both Perl and Python. I wrote the Python
stuff and inherited the Perl stuff. It is not web-based now
but conversion to generate html output instead of text is
probably straightforward. Additional requirement is that
is should be movable to unix without too much work.
The layers are:

[database] [equipment interface]
[glue]
[cgi]
[webserver - IIS]

As fo PHP/ASP/JSP? I am doing all the work. I know Perl
and Python. I don't know PHP/JSP. (Also, JSP will require
a lot of new Java infrastructure support, yes?) As for ASP,
I wonder about the "easily moved to unix" requirement.
(I know apache has an asp module but I don't know if other
web servers do, or how compatible apache's is, and I don't
know if I have time to reliably answer those questions.)
Why do you say PHP/JSP/ASP are superior technologies?

All I want to do is avoid the cost of starting a new Python
(or Perl) interpreter on each page request. This is what
I understand Perl-isapi and Perl-Ex does. My question
is simply if there is something similar for Python.
I have concluded the answer is no but hope I'm wrong.
 
R

rurpy

Atanas said:
Steve Holden wrote:
(e-mail address removed) wrote:

Pure cgi is too slow. "Active Scripting" means ASP, yes?
I need something that will do cgi scripts (a lot of which I already
have
and can modify but don't want to rewrite extensively, partly because
of time issues, partly because I want to preserve some degree of
portability back to a unix environment.). I want something that does
for IIS what mod_python does for apache. Fastcgi looked scary even
on unix plaforms, seems like an act of desperation on Windows,

Yes, ASP is Active Scripting.

Except I need cgi, not asp, for the reasons i gave.

it seems to me you have no clear idea what you need.

you say you have a lot of CGIs written but you don't clarify if that is
Python or Perl. since you look for python intergration, it seems they
are in python, however in previous posting you say you'll have to
revert to Perl for solution. it just doesnt make sense! if you use
Perl, you will have to REWRITE the scripts and if you do so, it's
unclear why wouldnt you use a superior technology like PHP/ASP/JSP -
any of those is way easier to manage.

it's also unclear why don't you use apache on windows, if mod_python is
your poison.

here is how i imagine you have the layers:
[scripts (CGI?)]
[glue]
[web server (IIS?)]

where the discussion is about the "glue" between them. you say CGI is
too slow for you, so you will want something maintaining the CGI
programming model, but faster. this thing is called FastCGI - but you
are unhappy about it either. there is no way any perl "glue" can solve
your problem between your web server and your python scripts
whatsoever. you'll have to re-code the scripts for perl.

The final solution must run in a Windows/IIS environment.
Those are part of the requirements which I do not control.
There is code in both Perl and Python. I wrote the Python
stuff and inherited the Perl stuff. It is not web-based now
but conversion to generate html output instead of text is
probably straightforward. Additional requirement is that
is should be movable to unix without too much work.
The layers are:

[database] [equipment interface]
[glue]
[cgi]
[webserver - IIS]

As fo PHP/ASP/JSP? I am doing all the work. I know Perl
and Python. I don't know PHP/JSP. (Also, JSP will require
a lot of new Java infrastructure support, yes?) As for ASP,
I wonder about the "easily moved to unix" requirement.
(I know apache has an asp module but I don't know if other
web servers do, or how compatible apache's is, and I don't
know if I have time to reliably answer those questions.)
Why do you say PHP/JSP/ASP are superior technologies?

All I want to do is avoid the cost of starting a new Python
(or Perl) interpreter on each page request. This is what
I understand Perl-isapi and Perl-Ex does. My question
is simply if there is something similar for Python.
I have concluded the answer is no but hope I'm wrong.

Din't find anything more and no further replies
here so here is a quick timing I did...
Perl-Ex: 0.014 sec/page
Perl-ISAPI: 0.168 sec/page
Perl-cgi: 0.187 sec/page
Python-cgi: 0.286 sec/page

I can't ignore the 20X better performance of
Perl-Ex vs Python, so I guess this is a loss
for Python and a win for Perl.
 
A

Atanas Banov

it is your loss as well (so, 2 losses and 1 win).

you comparing perl-ex with python-cgi is unfair, to say the least.
let's count:

1. you ditched python ASP, because you dont know how it may port on
linux (even if it's supported on apache and you probably never, ever,
will have to do the said port).

2. you ditched mod_python, because it's for apache and not for IIS.

3. you picked perl-ex, because... it works fast on IIS, even if it
doesnt work on apache or linux.

hard to speak about fairness here. besides i guess your tests are based
on dummy script pages, which do nothing and the real pages which
interface with DB and equipment, will spend 10 times more time doing
real work, say 1500ms. now tell me what is the difference between 1.514
sec and 1.786 sec wait time? and even if that were not the case, what
is the diffrence for a user between 0.014 and 0.286 seconds? part of a
blink of the eye?!

- nas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,292
Messages
2,571,494
Members
48,179
Latest member
รับปั๊มไลค์|LikePro

Latest Threads

Top