excel快速形成insert命令 用于快速插入数据库
import pandas as pd file=pd.read_excel('bb.xlsx') column = list(file.columns) for i in range(len(file)): x = [file.iloc[i][x] for x in range(len(column))] print("insert into table (%s) values (%s);"%(str(column).replace('[','').replace(']','').replace('','').replace("",''),str(x).replace("[","").replace(']','')))