from flask import Flask,render_template
import pandas as pd

app = Flask(__name__)


@app.route("/")
def index():
    data = pd.read_csv("qidian.csv")
    data = data.rename(columns={'类型':'name', '总数':'value'})

    data = data.to_dict(orient='records')
    print(data)
    data_2 = pd.read_csv("qidian_2.csv")
    data_2 = data_2.rename(columns={'作者': 'name', '总收藏': 'value'})
    data_2 = data_2.to_dict(orient='records')

    return render_template("ppp.html",data_2=data,data=data_2)


if __name__ == '__main__':

    app.run(host='0.0.0.0')#外部访问

queue = []
#向列表中插入元素
queue.insert(0,1)
queue.insert(0,2)
queue.insert(0,"hello")
print(queue)
print("取一个元素：",queue.pop())
print("取一个元素：",queue.pop())
print("取一个元素：",queue.pop())
