|
Revision 762
(checked in by fumanchu, 3 years ago)
|
Set svn:eol-style to "native" for all .py files. This should fix any line-ending problems for existing files: Windows users will receive CRLF endings when they check out files, and *nix users will receive LF endings. Whenever you "svn add" a new file, make sure its svn:eol-style property is "native"!
|
- Property svn:eol-style set to
native
|
| Line | |
|---|
| 1 |
""" |
|---|
| 2 |
Tutorial - Hello World |
|---|
| 3 |
|
|---|
| 4 |
The most basic (working) CherryPy application possible. |
|---|
| 5 |
""" |
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
import cherrypy |
|---|
| 9 |
|
|---|
| 10 |
class HelloWorld: |
|---|
| 11 |
""" Sample request handler class. """ |
|---|
| 12 |
|
|---|
| 13 |
def index(self): |
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
return "Hello world!" |
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
index.exposed = True |
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
cherrypy.root = HelloWorld() |
|---|
| 28 |
|
|---|
| 29 |
if __name__ == '__main__': |
|---|
| 30 |
|
|---|
| 31 |
cherrypy.config.update(file = 'tutorial.conf') |
|---|
| 32 |
|
|---|
| 33 |
cherrypy.server.start() |
|---|
| 34 |
|
|---|