摘要: 参考:http://zhoutall.com/archives/325 开了文件就得关, 用 with as 就省了 finally with-as表达式极大的简化了每次写finally的工作,这对保持代码的优雅性是有极大帮助的。 阅读全文
posted @ 2016-03-24 11:27 Pudding_AI 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 转自:http://www.crifan.com/summary_python_2_x_common_string_encode_decode_error_reason_and_solution/ Python 2.x中的字符编码,设计的的确不好,导致初学者,甚至是即使用Python很长时间的人,都 阅读全文
posted @ 2016-03-24 10:31 Pudding_AI 阅读(1090) 评论(0) 推荐(0) 编辑
摘要: 转自:http://www.crifan.com/python_head_meaning_for_usr_bin_python_coding_utf-8/ 是用来说明脚本语言是python的 是要用/usr/bin下面的程序(工具)python,这个解释器,来解释python脚本,来运行python 阅读全文
posted @ 2016-03-24 09:57 Pudding_AI 阅读(438) 评论(0) 推荐(0) 编辑