2011年1月12日水曜日

[CherryPy] Hello world

Solaris11 ExpressのCherryPy 3.1.2でhello world。

#!/usr/bin/env python
# coding: utf-8
import cherrypy

class Root:
        @cherrypy.expose
        def index(self):
                return "Hello, world"

# IN6ADDR_ANY(::) で LISTEN
cherrypy.server.socket_host = "::"
cherrypy.quickstart(Root())

ほぉほぉ。