Blog Post RSS ?

Blogs » PHP » Python Server Pages
 

Python Server Pages


  • Save to
    Del.icio.us

by Harry Fuecks

Via Simon’s blogmarksPython Server Pages.

Finally!

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? ;)

This post has 10 responses so far

  1. 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 £20 per month and virtual root servers for £10 a month. The only big reason not to use Python now is availability of developers, but in my experience so far clients don’t care what language their applications are developed in as long as it’s (i) recognised as a ‘legitimate’ programming language , and python is one of the LAMP bunch. (ii) won’t cost them any extra.

    If you can show them that Python will actually cost them less (speed of development is at least doubled in my experience) then they should jump at the opportunity.

    If you want to develop in Python, I suggest looking at Albatross (acts as a templating langauge) and Twisted/Nevow (Twisted is a http server system, amongst many other things, and Nevow is one of the most exciting templating frameworks I’ve seen).

    p.s. The majority of our web development is now done in Python

    Tim Pollenation Internet Ltd

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

     
  3. eeexxxellent smithers!

     
  4. 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. :’)

    matthew
    elijah.chpc.utah.edu

     
  5. 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.

     
  6. Hi,
    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
    Thanx..

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

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

     
  9. is there anyone know perl server pages or ruby services pages?
    thanx

     
  10. spyce.sourceforge.net is the best implementation of Python server pages.

     

Sponsored Links

Leave a response

You are not logged in, log in with your SitePoint Forum username and password.

-OR- Post Anonymously

* Make sure any code samples are escaped (i.e. ‘<b>’ becomes ‘&lt;b&gt;’).

If not logged in, your comments will be placed in a moderation queue. This means your comment may not appear until one of our moderators approves it.

SitePoint Marketplace

Buy and sell Websites, templates, domain names, hosting, graphics and more.

Logo Design, Web page Design and more!

99designs

  • Custom logo designs created ‘just for you’.
  • Pick the design you like best.
  • Only pay if you’re satisfied with the result.

It's Back!
FREE PDF with any printed book!