I have a cherrypy app that I\'m controlling over http with a wxpython ui. I want to kill the server when the ui closes, but I don\'t know how to do that. Right now I\'m just
I use os._exit. I also put it on a thread, so that I can serve up a "you've quit the server" page before exiting.
class MyApp(object): @cherrypy.expose def exit(self): """ /exit Quits the application """ threading.Timer(1, lambda: os._exit(0)).start() return render("exit.html", {})