File size: 557 Bytes
146b688 ea2d6ae b14be2c ea2d6ae 146b688 f7e9cda 146b688 b14be2c ea2d6ae |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
from flask import Flask, render_template
import pandas as pd
app = Flask(__name__)
@app.route('/')
def index():
# Load the CSV file into a DataFrame
df = pd.read_csv('leaderboard.csv')
df = df.round(3)
df.insert(0, '#', '')
# Convert the DataFrame to HTML
table_html = df.to_html(classes='table table-striped table-bordered', index=False)
# Render the template with the table HTML
return render_template('index.html', table_html=table_html)
if __name__ == '__main__':
app.run(host='0.0.0.0', port=7860, debug=True)
|