I've taken a bit of a shine to Python just recently. I like it for life's little scripting problems, you know, the sort of thing it's not worth opening up Visual Studio for. Anyhoo, I've been looking at doing web development using Python as well. The trouble here is that you can't embed Python in html like you can with PHP or ASP say. You have to have the Python CGI script generate the html, which is no big deal really but it does mean that it's a pain if anyone wants to skin your web application. They have to go into the Python code and make changes to the html, now what's the chance of them doing that without breaking anything? Slim I'd say. So, how to overcome this problem? I thought about it for a while and the solution's obvious really. Instead of generating html, I get the Python CGI to generate XML and apply a XSLT transform to it and then send it to the browser. Now, if anyone wants to skin my appliacation all the have to do is look at the schema to see what's in my XML and then ammend the XSLT file to provide the design they want. This pattern also works for other languages that you can write CGIs with but can't embed in html, like C++ for example.
(Technorati tag: , , )