Chuck Esterbrook wrote:
> "Don Tuttle" <tuttledon@...> wrote in message
> >"Chuck Esterbrook"
> > > * Python Server Pages (PSP, similar to ASP, PHP and JSP)
> >I 'm trying to get a handle on why I would want to use PSP on WinNt with
> >IIS. What's the difference/advantage to using PSP compared to using ASP
> >with embedded Python script?
>  Webware's PSP offers more syntax options than ASP. If I remember
> correctly, using Python in ASP involves some funkiness because of the clash
> between Pythonic indentation and HTML. I don't remember the details, but
> I'm positive they are chronicled in the archives of c.l.p.
> PSP also allows you to inherit one or more base classes which can be good
> for reusing code. I don't know if ASP lets you do that or not.
This is a great feature of PSP that I make use of a lot, and I am pretty sure ASP offers nothing similar.
> In any case, if you check the docs for PSP, you can see what various
> options you have compared to ASP:
>  Webware's PSP sits on top of WebKit, which means that when you use it,
> you can also create plain old Python servlets. You can also make your own
> "servlet factories". For example, you can write a handler that serves up
> *.sql, *.mytemplate, etc. There are also other components you can use with
> WebKit such as UserKit, MiddleKit, etc. Of course, that doesn't matter if
> you're not interested in these options, although using Webware puts you in
> a position to use them any time later.
>  A colleague of mine has had "caching" problems in ASP regarding out of
> date code residing in memory despite file modifications and reload()s. I
> can't say I know the details, and I won't say that you are guaranteed to
> suffer this if you use ASP+Python.
> Hope that helps. More details might be available from people who have
> extensively used both.
I recall that ASP with Python places limitations on what you can store in session variables. For example, if you try to place a dictionary into a session variable you'll get an error like "TypeError: Objects of type 'dictionary' can not be converted to a COM VARIANT". Generally, only "simple" types like integers, floats, strings, and lists of them can be placed into a session variable. WebKit/PSP has no such restrictions.
One more feature of WebKit/PSP that I _think_ doesn't exist in ASP, but I might be wrong: The ability to forward a request to another Servlet or PSP purely within the app server (as opposed to redirecting the browser). This allows you to do things like write a "controller" servlet that examines the request and then forwards to the appropriate servlet or PSP. It's a nice model for certain types of problems that is really simple to implement in WebKit/PSP, and I think it would be difficult or maybe even impossible in ASP.
On the flip side, one possible advantage of ASP with Python is that you might be able to take advantage of 3rd-party extensions that are designed to only work with ASP. I don't know if such things exist. I happen to be using a 3rd-party COM component in my web pages to draw dynamic graphs. The component was designed for use with Visual Basic and Active Server Pages, but it works great with WebKit too.
ASP/Python also has the dubious advantage of being an easier sell within a corporation than WebKit/PSP, which may or may not be important to you...
Overall, I think WebKit/PSP is significantly more productive and powerful than ASP, and I was able to convince my coworkers of that, so it's working out great for me :-)
- Geoff Talvola