Python读取excel展示在网页上

from flask import Flask
import pandas as pd
app=Flask(__name__)
@app.route(“/”)
def show_excel():
df=pd.read_excel(“huizong.xls”)
table_html=df.to_html()
#f in the string ,means have variable in string
return f”’
<html>
<body>
<h1>Excel Data</h1>
<dev>{table_html}</dev>
</body>
</html>
”’
if __name__==”__main__”:
app.run(host=”0.0.0.0″,port=9001,debug=True)