Skip to content

Instantly share code, notes, and snippets.

@pckujawa
pckujawa / webapp.py
Created March 29, 2012 02:39 — forked from alex/webapp.py
turn any python object into a web app
import traceback
class WebApp(object):
def __init__(self, obj):
self.obj = obj
def __call__(self, environ, start_response):
try:
path = filter(bool, environ["PATH_INFO"].split("/"))