import views.delete.getMessageData as getMsgData import views.delete.getCompareColName as getColumn from etc import settings from lib.excel import Excel from openpyxl.styles import PatternFill from lib.logger import StreamFileLogger _sflogger = StreamFileLogger(settings.LOG_FILE, __file__).get_logger() def get_diff_rowdNum(srcTuple, tgtTuple): _srcData = srcTuple[0] _tgtData = tgtTuple[0] _tgtStartNum = tgtTuple[1] _numlist = [] lineNum = _tgtStartNum for _tgtitem in _tgtData: if (_tgtitem not in _srcData): _numlist.append(lineNum) lineNum += 1 return _numlist def get_matchIdx_rowdNum(srcTuple, tgtTuple): _srcData = srcTuple[0] _srcStartNum = srcTuple[1] _tgtData = tgtTuple[0] _tgtStartNum = tgtTuple[1] #store match rowNum in both file _numlist = []
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 3/23/18 4:32 PM # @Author : Miracle Young # @File : app.py from lib.logger import StreamFileLogger from lib.excel import Excel from utils import settings _sflogger = StreamFileLogger(settings.LOG_FILE, __file__).get_logger() _sflogger.info(1) _sflogger.debug(2) try: a except Exception as e: _sflogger.error('Failed', exc_info=True) excel_name = settings.SRC_DATA['a.xlsx'] excel = Excel(excel_name) excel.get_column_names('CAPS Industry KPIs New', 'A1', 'F28') # get all sheetname excel.read_excel_by_pos('CAPS Industry KPIs New', 'A1', 'F28') #