coding:gbkimport _xlrd,re,xlwt,datetime,csv,time_from _xlutils.copy _import _copy_version =’1.2.4’class _MyExcel(object): _def _GetCsvContent(self,_filepath,project): with _open(_filepath,’r+’,encoding=’utf-8’,errors=’ignore’) as _rfile: reader = csv.reader(rfile) _for _line _in _reader: # print(line) # print(str(line).encode(‘gbk’,’ignore’).decode(‘gbk’,’ignore’)) _if _line[0]==’Bug编号’: _yield _line _if _line[1]==_project: _yield _line直接不打印出来,跳过coding:gbkimport _xlrd,re,xlwt,datetime,csv,time_from _xlutils.copy _import _copy_version =’1.2.4’class _MyExcel(object): _def _GetCsvContent(self,_filepath,project): with _open(_filepath,’r+’,encoding=’utf-8’,errors=’ignore’) as _rfile: reader = csv.reader(rfile) _for _line _in _reader: # print(line) # print(str(line).encode(‘gbk’,’ignore’).decode(‘gbk’,’ignore’)) _if _line[0]==’Bug编号’: _yield _line _if _line[1]==_project: _yield _line直接不打印出来,跳过