# -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
import numpy as np
import pandas as pd
import os
os.chdir('C:/Users/dell-3020/Desktop/')
df = pd.read_excel('100.xlsx')
#print(type(data))#<class 'pandas.core.frame.DataFrame'>
t = df.head(5000)
#print(data)
#t = pd.DataFrame(data) #<class 'pandas.core.frame.DataFrame'>
#print(t)
#print(t['account_number'])
path = 'C:\\Users\\dell-3020\\Desktop\\100.txt'
f = open(path, 'w', encoding = 'utf8')
for i in t.index:
#上面的直接用str就可以,下面的不行
c = 'update contract_info set money='+t.loc[i]['money'].__str__()+' where contract_number='+'\''+t.loc[i]['account_number']+'\''+';'
#print(c)
f.write(c+'\n')
f.close()