pannyvan

导航

2015年4月21日 #

Python 之 Bunch Pattern

摘要: When prototyping (or even finalizing) data structures such as trees, it can be useful to have a flexible class that will allow you to specify arbitrar... 阅读全文

posted @ 2015-04-21 20:33 pannyvan 阅读(525) 评论(0) 推荐(0) 编辑

python 处理中文文件时的编码问题,尤其是utf-8和gbk

摘要: python代码文件的编码py文件默认是ASCII编码,中文在显示时会做一个ASCII到系统默认编码的转换,这时就会出错:SyntaxError: Non-ASCII character。需要在代码文件的第一行或第二行添加编码指示:# coding=utf-8 ##以utf-8编码储存中文字符pri... 阅读全文

posted @ 2015-04-21 19:59 pannyvan 阅读(701) 评论(0) 推荐(0) 编辑