- 博客(2)
- 收藏
- 关注
原创 python将前端上传的excel表中数据导入数据库
def export_excel_to_mysql(): f = request.files["file"]#从前端拿到上传的excel f.save(f'excels/{f.filename}') #存在服务器上 book = xlrd.open_workbook(f"./excels/{f.filename}")#打开需要导入数据库的excel表 sheet=book.sheet_by_name("Sheet1") conn, cur = connect_to_d
2021-04-26 11:06:16 731 1
转载 @getMapping与@postMapping注解
@getMapping与@postMapping首先要了解一下@RequestMapping注解。@RequestMapping用于映射url到控制器类的一个特定处理程序方法。可用于方法或者类上面。也就是可以通过url找到对应的方法。@RequestMapping有8个属性。value:指定请求的实际地址。method:指定请求的method类型(GET,POST,PUT,DELETE)等。consumes:指定处理请求的提交内容类型(Context-Type)。produces:指定返回的内
2020-11-05 20:17:22 749
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人