我是cherrypy的新手。我刚刚尝试了一个wsgiserver的示例程序。程序如下
from cherrypy import wsgiserver
def my_crazy_app(environ, start_response):
status = '200 OK'
response_headers = [('Content-type','text/plain')]
start_response(status, response_headers)
return ['Hello world!']
server = wsgiserver.CherryPyWSGIServer(
('127.0.0.1', 8080), my_crazy_app,
server_name='localhost')
server.start()
我Hello world
成功获得了输出,但问题是当我点击Ctrl-c
终端停止服务器时,它并没有停止。怎么做?