Python for Webscripting (like PHP)

Alessandro Bottoni alessandro.bottoni at infinito.it
Thu Aug 18 08:32:56 EDT 2005


Florian Lindner wrote:
> How suitable is Python for these kind of projects? What do think? Does the
> stdlib offers all basic functions for this kind of requirements?

Python is extremely well suited for the web-app development and the STDLib
supply most of what you need for this task. As a matter of fact, the easy 
development of web applications was one of the main focuses of the Python
community since Rel 1.0. Thanks to the hard work of its supporters, Python
is now widely considered one of the best tool you can use for developing
web applications, even better than PHP.

Have a look at these chapters of the official Python documentation to get
convinced of what I'm saying:
Chap. 11: Internet Protocols and Support
Chap. 12: Internet Data Handling
Chap. 13: Structured Mark-Up Languages Processing

(Python has even been told to be used by Yahoo! and Google, among others,
but nobody was able to demonstrate this, so far)

Despite this, keep in mind that developing a _real_world_ web application
without the right tools (session management and templating, in particular)
is quite hard, no matter which language you use (even with PHP).

Have a look at the many web frameworks mentioned at http://www.python.org/
and at http://www.vex.net/parnassus/ and choose the one you feel best
suited for your task.

Among these web framework, a couple of them deserve a particular attention:

Maki is a XML based framework, very similar to the java-based Cocoon:
http://maki.sourceforge.net/
http://cocoon.apache.org/

Albatross is aimed to stateful applications:
http://www.object-craft.com.au/projects/albatross/

Regarding the template engine, the best one I'm aware of is Cheetah:
http://www.cheetahtemplate.org/

A last word: beware of PSP (Python Server Pages). If used in the wrong way,
this tool (like the original Java Server Pages) can make a real mess of
your code (because of the inextricable tangle of Python and HTML code you
can create).

CU

-----------------------------------
Alessandro Bottoni



More information about the Python-list mailing list