我的瓶子有问题,该_initialize
功能运行了两次。示例应用程序:
@route("/index")
def index():
return "bang"
def _initialize():
print("bam")
if __name__ == "__main__":
_initialize()
run(reloader=True, host="localhost", port = 8990)
输出是:
bam
bam
Bottle v0.11.rc1 server starting up (using WSGIRefServer())...
Listening on http://localhost:8080/
Hit Ctrl-C to quit.
为什么会发生这种情况,我该如何在瓶中进行这种预初始化?