python-fastcgi扩展

关于
python-fastcgi C库的文档并不多,所以我想知道是否有人可以提供一个简单的例子来说明如何用它制作一个简单的FastCGI服务器. “Hello World”示例会很棒. 最佳答案 编辑:我误解了这个问题.糟糕!

Jon’s Python modules是一组有用的模块,包括一个很棒的FastCGI模块:http://jonpy.sourceforge.net/fcgi.html

以下是该页面的示例:

import jon.cgi as cgi 
import jon.fcgi as fcgi

class Handler(cgi.Handler):
  def process(self, req):
    req.set_header("Content-Type", "text/plain")
    req.write("Hello, world!\n")

fcgi.Server({fcgi.FCGI_RESPONDER: Handler}).run()
点赞