advertisement

Article:
  What Is TurboGears (Hint: Python-Based Framework for Rapid Web Development)
Subject:   the REAL PHP replacement... (and more...)
Date:   2006-03-06 12:13:33
From:   jon_perez

import cherrypy


class MyRoot:

@cherrypy.expose()
def index(self, who="World"):
return "Hello, %s!" % (who)


It really doesn't get much simpler than that... ?


Baloney... how about:



<html>
<body>
<%\
print "hello, world"
%>
</body>
</html>


Now THAT'S simple. This is what you get with Spyce.


Kid templating engine?


Custom tags (ala JSP), should be far easier on the eyes compared to gobbledygook like:



<table>
<tr py:for="gear in turbogears">
<td><span py:content="gear.name">TurboGears</span></td>
</tr>
</table>


Mochikit claims to give you a nice XML API. Just about anything will be better than bad old DOM, but Mochikit's XML interface is still far from being as Pythonic as Fredrik Lundh's ElementTree (although of course this is Python-only and server-side).


Why is Spyce so under the radar despite its being so cool...? I think it's because a Spyce article on O'Reilly Net is long overdue... ;-).


Another reason... code samples for Spyce features brackets [[ and ]] to delimit code instead of the more appealing <%, %>. I think that is harder on the eyes and what may have turned many people off.