首页 > 数据库技术 > 详细

python--读取excel通过django框架入库mysql(完整代码)

时间:2020-01-18 00:38:29      阅读:152      评论:0      收藏:0      [点我收藏+]
import xlrd , uuid
class
JenkinsImport(View): def get(self,request): xls = xlrd.open_workbook(./test.xls) sheets = xls.sheet_names() # 所有sheet,列表 table = xls.sheets()[1] rows = table.nrows for line in range(1, rows): item = table.row_values(line) print(item) text = item[1] # excel第二列 snippet = Categroy.objects.create( text = text if text else None, cate_uuid=uuid.uuid4(), )return JsonResponse({})

python--读取excel通过django框架入库mysql(完整代码)

原文:https://www.cnblogs.com/lutt/p/12207871.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!