离开这个例子,有人可以告诉我为什么我不能用 Ctrl+C 杀死这个程序:
#!/usr/bin/env python
import web
import threading
class MyWebserver(threading.Thread):
def run (self):
urls = ('/', 'MyWebserver')
app = web.application(urls, globals())
app.run()
def POST (self):
pass
if __name__ == '__main__':
MyWebserver().start()