i have some that should not execute again when reload flask it should be work only once even reload flash
from flask import *
from wxpy import *
app = Flask(__name__)
bot = None
@app.route('/')
def hello_world():
return 'hi,my hello ,iiiHello wxpy! not reload bot'
@app.route('/hello/')
def hello():
return "hello"
@app.route('/friends/')
def hellos():
guys = bot.friends()
return render_template('hello.html', guys=guys)
def init_bot():
bot = Bot(console_qr = 1)
return bot
if __name__ == '__main__':
bot = init_bot()
app.run(debug=True,use_reloader=False)
i just use wxpy and flask to write webs i want to reload flask auto but i do not want to execute the Bot init funciton again,for a i need to scan qr-code any one can help me i can modiy code and take effect immediately but do not need to scan qr-code again