By Harry Fuecks

Python Server Pages

By Harry Fuecks

Via Simon’s blogmarksPython Server Pages.


Personally think this is great news. Up until now (ignoring third party Python projects which have tried this), mod_python has had an awkward deployment mechanism (much like mod_perl, if you know it) requiring definition of handlers, within Apache. Python Server Pages make it pretty much the same as creating PHP pages – just tell Apache to watch out for .psp files and away you go.

If you’re wondering why I’m talking about Python on a PHP blog, I don’t have a clear answer for you. Python is a very well designed language. For my tastes, perhaps most pleasant to work with, out of the dynamically typed family (e.g. Perl, PHP, JavaScript and Ruby).

As a solution for web applications, PHP has a significant head start over Python, with massive support amongst hosting providers and almost all the functionality you need “ready to go”. Also there’s a huge weight in supporting projects for PHP, as John Lim suggests here.

That said, Python comes with all those things that itch PHP developers, such as support for namespaces and an in-built (i.e. free) mechansim that stores a “compiled” form of your scripts. And things like the distutils solve many a headache for distributing your work.

So Python Server Pages is an alternative to PHP. Perhaps competition is a good thing, PHP being much like a monopoly these days.

Turns out Sterling Hughes, who’s one of PHP’s core developers, provided the basis for the PSP add-on to mod_python, as he mentioned a while back here. Et Tu, Brute? ;)

  • Tim Parkin

    Ah, the joy of Python.. as a PHP programmer who makes his living out of building PHP applications, I know the frustrations that can be had building systems in a language like PHP. The disadvantages of PHP have been documented many times so I won’t go into them. I’ll only say that I’ve been programming in PHP for a long time and I’m still being surprised by some behaviours.

    Python, on the other hand, just lets you get on with coding. I find I hardly ever have to refer to the manual to try to understand behaviour as in most cases things act like you would expect (which is one of the tenets of the language).

    I used to think that we’d still have to use a lot of PHP as people’s service providers offer it and are unlikely to offer Python. However, we can now get dedicated servers for

  • Hannes Gassert

    Greate last sentence!
    “Then fall, PHP!”, to conclude your quotation :)

  • alr

    eeexxxellent smithers!

  • ruach

    This IS great news ! and its about time. Personaly I love php for the web but I love python even more, just not for the web. If hosting companies began to support python and some good modules were developed to handle things like sessions, file uploads, cookies and the like I think that it could easily become the new king of the web. In do time of course. :’)


  • Python is probably the simplest OOP language ever. I have programmed in PHP in the past; currently I’ve been using Python a lot, and evangelize its use.

  • Gokul

    I’d like some of u guys advice me..
    I’ve to design a course site manager 4 my university using any interface language.What wud u guys recommend??
    php or cgi( integrated with python) or ZOPE??plz reply soooon

  • thanos

    use php (nocgi) since you’ll be able to get started quickly.

  • Mary

    Hi, what huppen with security on PSP? have problems of browsers??

  • yangce

    is there anyone know perl server pages or ruby services pages?

  • Anonymous is the best implementation of Python server pages.

Get the latest in Front-end, once a week, for free.