PYTHON --工作中应用

分批将结果写入库:
start = 0 while True: tmp_list = datas_list[start:start+5000]: self.upsert_sqlserver_data(tmp_list,pre='customize',database=self.sqlserver_cust) start+=5000 if start > len(datas_list)-1: break

2、逐条入库(传参只能是列表)

 for i in datas_list:
            self.upsert_sqlserver_data([i,], pre='customize', database=self.sqlserver_cust)

  

  

  

posted @ 2021-03-11 17:34  yongqi-911  阅读(44)  评论(0编辑  收藏  举报