Python:3.4
因此,以下代码在python控制台中抛出错误。
但是append
正在运行,我在新列表中得到了正确的(replace
进程已完成)值。
mobile = []
for col in ws.iter_cols():
for cell in col:
if cell.value == 'Mobile':
x=column_index_from_string(cell.column)
for row in ws.iter_rows(min_col = x, min_row = 2, max_col = x):
for cell in row:
mobile.append(cell.value)
mob_f = []
for i in mobile:
h = i
h = h.replace(" ","")
h = h.replace("+(91)-",",")
h = h.replace("+91","")
h = h.replace("-","")
mob_f.append(h)
错误:
追踪(最近一次通话): 文件"",第3行,in AttributeError:' NoneType'对象没有属性'替换'