2021년 9월 29일 수요일

excel에 첨부된 이미지 추출.

# -*-coding:utf-8-*-

from openpyxl import load_workbook
from openpyxl_image_loader import SheetImageLoader


def main():
filepath = './excel/sample.xlsx'
load_wb = load_workbook(filepath, data_only=True)
for sheet_name in load_wb.sheetnames:
sheet = load_wb[sheet_name]

image_loader = SheetImageLoader(sheet)
# image = image_loader.get('C3')
# image.show()
print(sheet.max_row, sheet.max_column)
for column in range(sheet.max_column):
column = chr(ord('A') + column)
for row in range(sheet.max_row):
cell_id = '{0}{1}'.format(column, row)
print(cell_id)
if image_loader.image_in(cell_id):
print(cell_id, '->', image_loader.image_in(cell_id))


if __name__ == '__main__':
main()

댓글 없음:

댓글 쓰기

docker redmine 설치

docker-composer.yml version: '3.1' services:      redmine:           image: redmine           restart: always           container_na...