Package cherrypy :: Package tutorial :: Module tut08_generators_and_yield
[hide private]
[frames] | no frames]

Module tut08_generators_and_yield

source code

Bonus Tutorial: Using generators to return result bodies

Instead of returning a complete result string, you can use the yield statement to return one result part after another. This may be convenient in situations where using a template package like CherryPy or Cheetah would be overkill, and messy string concatenation too uncool. ;-)

Classes [hide private]
  GeneratorDemo
Variables [hide private]
  tutconf = '/build/cherrypy3-miweZ4/cherrypy3-3.2.2/cherrypy/tu...
  __package__ = 'cherrypy.tutorial'
Variables Details [hide private]

tutconf

Value:
'/build/cherrypy3-miweZ4/cherrypy3-3.2.2/cherrypy/tutorial/tutorial.co\
nf'