def start(self, callback=None):
self.loop.run_until_complete(self.server)
try:
path = os.path.dirname(os.path.realpath(__file__))
webbrowser.open('file:///' + os.path.join(path, 'index.html'))
self.loop.run_forever()
except KeyboardInterrupt:
pass
finally:
self.server.close()
self.loop.close()
if callback is not None and callable(callback):
callback()
评论列表
文章目录