of servlet & py

I somehow stumbled upon web.py, and it seems interesting enough (quite a few people actually use it in production), given that it's only 73kb, unobtrusive, simple, the tutorial works etc..

I could go on and on, but the most effective way is to give an example :
import web

urls = (
'/(.*)', 'hello'

class hello:
def GET(self, name):
i = web.input(times=1)
if not name: name = 'world'
for c in xrange(int(i.times)): print 'Hello,', name+'!'

if __name__ == "__main__": web.run(urls)
this is a simple, classic Hello world example. given u have already installed python, u just have to double-click the file, and point your browser to localhost:8080 ...
That's about it, no installation, configuration (yet), no nothing, just plain simple script :lol:

but when i'm trying the template example/tutorial, it gave me a 500 error, and then that's where cheetahtemplate came, download and install, voila it works..

then webware came to my eye (somehow), and some of its premises is servlets (wtf, servlet in python? damn good, im drooling already :lol:) which rocks, psp (jsp/php equivalent), and some other things..

previously, i had some trouble figuring out how to web-enabled the A* python algo, now it's officially solved (now, if only i had the time T_T)..

No comments: