擅长:python、mysql、java
<p>try/except放在错误的级别上,您想尝试读取,当失败时继续循环。这意味着try/except必须在循环中:</p>
<pre><code>xap = np.empty([0])
for i in inlist:
try:
xap=np.concatenate((xap,ncread(i)[0]))
except IOError as e:
print "I/O error({0}): {1}".format(e.errno, e.strerror)
continue
</code></pre>