shell
pip install Flask pandas
python
from flask import Flask, request, render_template
import pandas as pd
app = Flask(__name__)
@app.route('/')
def home():
return render_template('index.html')
@app.route('/process_data', methods=['POST'])
def process_data():
file = request.files['file']
data = pd.read_csv(file)
return processed_data.to_html()
if __name__ == '__main__':
app.run(debug=True)
html
<!DOCTYPE html>
<html>
<head>
<title>Data Processing App</title>
</head>
<body>
<h1>Data Processing App</h1>
<form action="/process_data" method="post" enctype="multipart/form-data">
<input type="file" name="file" accept=".csv">
<input type="submit" value="Process">
</form>
</body>
</html>