0

with this code, I am checking if the value in the column check_val is true or not, and create list of Ticker to render on html webpage.

as the values in check_val column changes frequently, to make sure that correct list is rendered, i call this endpoint every 10 seconds using following line in html file

<meta http-equiv="refresh" content="10">

.

@app.route('/check')
def check():
    filename = r'C:\Users\91956\Desktop\Book.xlsm'
    df = pd.read_excel(filename)

    df = df.loc[df['check_val'] == True]
    ticker_list = df['Ticker'].to_list()
 

    return render_template('layout.html',lis = ticker_list)

this causes refresh of page every 10 seconds. is there any other alterative to accomplish this, without refreshing the page?

5
  • Have you considered using javascript to update just the table every 10 seconds instead of the whole page? Commented Apr 20, 2021 at 13:14
  • as the dataframe is created using excel file, while updating table i need to access excel file, how to do this using javascript Commented Apr 20, 2021 at 13:24
  • You don't need to refresh the page. You should send request via javascript. You use plain HTML? Commented Apr 20, 2021 at 13:33
  • Javascript doesn't access your excel file, javscript asks your server for the updated data. It is the function of your server to access your excel file and format it for javascipt to understand. Commented Apr 20, 2021 at 13:52
  • It's a lot resources out there... try this one stackoverflow.com/questions/51913220/… Commented Apr 20, 2021 at 14:08

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.