📅  最后修改于: 2022-03-11 14:47:06.926000             🧑  作者: Mango
try:
with open('sample.txt','r') as file:
for line in file:
(some action here)
except IOError:
except IOError as (errno, strerror):
print "I/O error({0}): {1}".format(errno, strerror)