share data


import
uuid import openpyxl from openpyxl.chart import BarChart, Series, Reference from openpyxl.chart.layout import Layout, ManualLayout def generate_testing_data(file_name): excel = openpyxl.Workbook() table = excel.active table.title = 'Latest List' table.cell(row=1, column=1, value='Count') table.cell(row=1, column=2, value='333') table.cell(row=2, column=1, value='ISIN list as of 29Jan') for row in range(3, 100): table.cell(row=row, column=1, value=str(uuid.uuid1())) excel.save(file_name) def extra_data_from_excel(excel_file_name): excel = openpyxl.load_workbook(excel_file_name) table = excel.get_sheet_by_name('Latest List') for row in range(3, table.max_row): cell = table.cell(row=row, column=1) if cell.value: print('[ISIN].[ISIN].[ISIN].[{}],'.format(cell.value)) if __name__ == '__main__': file_name = 'testing_excel.xlsx' generate_testing_data(file_name) extra_data_from_excel(file_name)

 

 

代码比价网站: https://editor.mergely.com/

 

posted on 2021-02-01 20:28  stupid_one  阅读(116)  评论(1编辑  收藏  举报

导航