我for在Python中有一个简单的循环,即使异常块包含一个异常块,也会退出异常continue.当它击中IndexError并退出for循环时,仍有大约10行可供阅读.我在这里错过了什么?
for row in hkx: ##'hkx' are rows being read in from 'csv.open'
try:
print row[2],row[4]
except IndexError, e:
print 'Error:',e
print 'Row Data:',len(row),row
continue ## I thought this would just move on to the next row in 'hkx'
Run Code Online (Sandbox Code Playgroud)
(对不起,这里的Python新手......)提前致谢!