2012年2月6日
摘要: #!/usr/bin/python#-*-coding:cp936-*-#思路,将str转换成unicode,方可用正则表达式,前提是,要知道文件的编码,本例中是gbkimportcPickleasmypickleimportreimportsysif(__name__=='__main__'):fid1=file('above50purenames.txt','r');p=re.compile('(^\s+|\s+$)');phanzigbk=re.compile('[\\x20-\\x7f]');phanzi= 阅读全文
posted @ 2012-02-06 23:14 finallyly 阅读(27246) 评论(0) 推荐(0) 编辑