import time
import cherrypy

class Chunky(object):
    _cp_config = {
        'response.stream' : True,
    }

    @cherrypy.expose
    def index(self):
        for i in range(10):
            val =  "Chunk %s" % i
            print val
            yield val
            time.sleep(0.5)

cherrypy.quickstart(Chunky())

