def export_excel_to_mysql():
f = request.files["file"]#从前端拿到上传的excel
f.save(f'excels/{f.filename}') #存在服务器上
book = xlrd.open_workbook(f"./excels/{f.filename}"
python将前端上传的excel表中数据导入数据库
最新推荐文章于 2024-02-26 16:52:58 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)
def export_excel_to_mysql():
f = request.files["file"]#从前端拿到上传的excel
f.save(f'excels/{f.filename}') #存在服务器上
book = xlrd.open_workbook(f"./excels/{f.filename}"