我正在尝试使用简单的WSGI Web服务:
from flup.server.fcgi import WSGIServer
import sys, os
def app(environ, start_response):
start_response('200 OK', [('Content-Type', 'text/html')])
yield '<h1>FastCGI Environment</h1>'
yield '<table>'
for k, v in sorted(environ.items()):
yield '<tr><th>{0}</th><td>{1}</td></tr>'.format(
escape(k), escape(v))
yield '</table>'
if __name__ == '__main__':
WSGIServer(app).run()
我收到此错误:
Traceback (most recent call last): File "test.py", line 19, in <module> WSGIServer(app).run() File "C:\Anaconda2\lib\site-packages\flup\server\fcgi.py", line 112, in run sock = self._setupSocket() File "C:\Anaconda2\lib\site-packages\flup\server\fcgi_base.py", line 978, in _setupSocket sock = socket.fromfd(FCGI_LISTENSOCK_FILENO, socket.AF_INET, AttributeError: 'module' object has no attribute 'fromfd'
这是什么意思?