'reload flask website when pickle file modifies

In Flask when the pickle file is modified I want to reload my website

This is the function witch I want to reload

@app.route("/")
def home():
    with open('bill.pkl', 'rb') as handle:
        b = pickle.load(handle)
    total=0
    units=0
    for i in b:
        total=total+b[i]['totalPrice']
        units=units+b[i]['unit']
    
    
    return render_template("home.html",bill=b,units=units,total=total)

In bill.ipkl I am adding Dictionary object at run time from another program witch is running continuously



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source