X-Git-Url: http://www.dolda2000.com/gitweb/?p=ashd.git;a=blobdiff_plain;f=examples%2Fpython%2Fwsgidir%2Fpy3.wsgi3;fp=examples%2Fpython%2Fwsgidir%2Fpy3.wsgi3;h=0dc781898919b974805192c0af9f03baf802bb5f;hp=0000000000000000000000000000000000000000;hb=8774cda21dfafd73df99686ded102c4f6f5e2d2e;hpb=84a034e1e63195a8378acacb35eae8e45ef78f0f diff --git a/examples/python/wsgidir/py3.wsgi3 b/examples/python/wsgidir/py3.wsgi3 new file mode 100644 index 0000000..0dc7818 --- /dev/null +++ b/examples/python/wsgidir/py3.wsgi3 @@ -0,0 +1,14 @@ +import sys, ashd.wsgiutil + +def application(env, startreq): + startreq("200 OK", [("Content-Type", "text/html")]) + # Note that WSGI 3 requires returned data to be bytes, not strings. + yield b"\n" + yield b"Hello world from Python3!\n" + yield b"\n" + yield b"

Hello world from Python3!

\n" + yield b"

This example does nothing in particular except demonstrating " + yield b"that there is support for Python3 as well.

\n" + yield b"

The current Python interpreter is " + ashd.wsgiutil.htmlquote(sys.version).encode("utf-8") + b".

" + yield b"\n" + yield b"\n"