摘要: 三个代码等价。with还可以很好的处理上下文环境产生的异常。123file = open("/tmp/foo.txt")data = file.read()file.close()12345file = open("/tmp/foo.txt")try:data = file.read()finall... 阅读全文
posted @ 2014-11-06 10:02 tina_ma 阅读(194) 评论(0) 推荐(0) 编辑