I was hoping that putting 'sys.exit(1)' and catching it later like this will work.
xml_open()
try:
run(reloader=True, host='localhost', port=8080)
except SystemExit:
xml_save()
print "Exited ..."
Is there any other solution to exit these python micro-frameworks to exit from inside the handlers ?