摘要:
#!/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= 阅读全文