import codecs
with codecs.open(u'../../../data.txt', 'w', 'utf-8') as f:
with codecs.open('../../../data.txt', 'r', 'utf-8') as f:
pattern_year = re.compile(u'\d{4}款')
在Windows下也要用 ' / ' not ' \\ '
------------------------------reference--------------------------------
1. http://blog.csdn.net/willhuo/article/details/49358273