from wsgiref.util import setup_testing_defaults
from wsgiref.simple_server import make_server
import bz2
def simple_app(environ, start_response):
status = '200 OK'
headers = [('Content-type', 'application/x-bzip2')]
start_response(status, headers)
word = ""
for key, value in environ.iteritems():
word += "%s: %s\n" % (key, value)
ret = bz2.compress(word)
return ret
httpd = make_server('', 8000, simple_app)
print "Serving on port 8000..."
httpd.serve_forever()
from wsgiref.simple_server import make_server
import bz2
def simple_app(environ, start_response):
status = '200 OK'
headers = [('Content-type', 'application/x-bzip2')]
start_response(status, headers)
word = ""
for key, value in environ.iteritems():
word += "%s: %s\n" % (key, value)
ret = bz2.compress(word)
return ret
httpd = make_server('', 8000, simple_app)
print "Serving on port 8000..."
httpd.serve_forever()
Hiç yorum yok:
Yorum Gönder