摘要: 异常的使用和文件的读取存储1 try:2 data = open('c:/Python33/source/file.txt')3 except IOError :4 print('can not find the file')在捕获异常是可以指定异常类型,如果open指定路径下的那个文件不存在则抛出IOError异常通过捕获的异常来确定错误信息1 try:2 data = open('c:/Python33/READ.txt')3 except IOError as err:4 print('file errpr' + str(e 阅读全文
posted @ 2013-05-12 18:23 拙急鸟 阅读(199) 评论(0) 推荐(0)