Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Python : Simplest Http Server With Cherrypy

DZone's Guide to

Python : Simplest Http Server With Cherrypy

·
Free Resource
taken from http://www.cherrypy.org/wiki/CherryPyTutorial
in the browser, return a "Hello world!" at http://localhost:8080(/index)

from cherrypy import cpg

class HelloWorld:

    @cpg.expose
    def index(self):
        return "Hello world!"

cpg.root = HelloWorld()
cpg.server.start()
Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}