python - 使用烧瓶应用程序检查数据框中的值变化
问题描述
使用此代码,我正在检查列中的值是否check_val
为真,并创建Ticker
要在 html 网页上呈现的列表。
由于列中的值check_val
经常更改,为了确保呈现正确的列表,我使用 html 文件中的以下行每 10 秒调用一次此端点
<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)
这会导致每 10 秒刷新一次页面。在不刷新页面的情况下,是否有其他替代方法可以完成此操作?
解决方案
推荐阅读
- kaldi - Kaldi的TDNN和LSTM的相关论文有哪些?
- android - 提交到Play商店后应用程序无法正常工作
- ajax - 如何抓取 AJAX 页面中的所有 url?
- r - 使用 `case_when` 和 `str_split` 的组合来改变数据框中的列
- angular - 像我们使用 jquery 或 vanilla javascript 那样在 Angular 6 中进行 dom 操作的最佳方法是什么
- objective-c - 在 Objective-C 中使用单例保留循环
- powershell - New-AzureADMSInvitation 仅适用于尚未受邀的用户
- python - 如何在熊猫数据框列上打印给定字符串的出现?
- php - PDF 未在 FPDF 中下载
- python - 如何在诸如 mixin 之类的公共类中捕获所有异常