def add_gbbq(mypath,need_list=[]):
'更新本变迁资料(采用临时列表法)'
gbbq_list = []
end_row = []
if len(need_list) == 0:
return gbbq_list,end_row
print('正在更新财务数据,请稍候……')
wb = load_workbook(mypath + 'base\\gbbq.xlsx')
ws = wb.active
gb_list = []
for i in range(2,ws.max_row+1):#股本变迁资料转为列表
for j in range(1,9):
if j != 2:#股票名称不提取
gb_list.append(ws.cell(i,j).value)
for file_name in need_list:
if file_name =='sh000001':
continue
bq_list = []
file_num = file_name[2:]
while i < len(gb_list):#提取文件的股本变迁资料
if gb_list[i] == file_num:
05-06