python:cherrypy_notes
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | python:cherrypy_notes [2016/07/15 01:29] (current) – created mithat | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== CherryPy Notes ====== | ||
+ | Method names map to URLs. The following defines /index and /generate URLs: | ||
+ | <code python> | ||
+ | import random | ||
+ | import string | ||
+ | |||
+ | import cherrypy | ||
+ | |||
+ | class StringGenerator(object): | ||
+ | @cherrypy.expose | ||
+ | def index(self): | ||
+ | return "Hello world!" | ||
+ | |||
+ | @cherrypy.expose | ||
+ | def generate(self): | ||
+ | return '' | ||
+ | |||
+ | if __name__ == ' | ||
+ | cherrypy.quickstart(StringGenerator()) | ||
+ | </ |
python/cherrypy_notes.txt · Last modified: 2016/07/15 01:29 by mithat