def load_keyword_from_datebase(): reload(sys) sys.setdefaultencoding('utf-8') allkeyword = [] file = 'config\cfg_allsearch\database.xls' data = read_excel.open_excel(file) table = data.sheet_by_name('all') for row_date in range(1, read_excel.rownum(file,'all')): keyword = table.cell(row_date, read_excel.find_colum(file,'all','keyword')).value allkeyword.append(keyword) return allkeyword
def load_keyword_from_AppTestCase(): file = '..\AppTestCase.xls' allkeyword = [] for sheetname in read_excel.sheets_name(file): if "CAS" in sheetname: data = read_excel.open_excel(file) table = data.sheet_by_name(sheetname) reload(sys) sys.setdefaultencoding('utf-8') for row_date in range(5, read_excel.rownum(file,sheetname)): keyword = table.cell(row_date, read_excel.find_colum(file,sheetname,'data')).value if keyword == '': pass elif "\n" in keyword: for n in str(keyword).split("\n"): if n == "": pass elif "," in keyword: for m in str(keyword).split(","): if m != '': allkeyword.append(m) else: pass elif "," in keyword: for o in str(keyword).split(","): if o != "": allkeyword.append(o) else: pass else: allkeyword.append(keyword) reload(sys) sys.setdefaultencoding('utf-8') return allkeyword
# -*- coding: UTF-8 -*- __author__ = 'guyh' from common.trd import read_excel file = 'datebasea.xls' data = read_excel.open_excel(file) table = data.sheet_by_name('2') table1 = data.sheet_by_name('1') aa = [] bb = [] cc = [] dd = [] for row_date in range(0, read_excel.rownum(file,'2')): keyword = table.cell(row_date, 0).value if "," in str(keyword): abc = str(keyword).split(",") for n in str(keyword).split(","): aa.append(n) else : aa.append(keyword) for row_date in range(0, read_excel.rownum(file,'1')): keyword = table1.cell(row_date, 0).value bb.append(keyword) if keyword in aa: dd.append(keyword) else : print keyword