
python
xu187
热爱生活,热爱编程
展开
-
python-遍历目录下所有文件和分析两个json文件
#判断两个文件是否互为新旧两个版本def contrastTwoFile(oldSpcial_file_dir,newSpcial_file_dir): f_1 = file(oldSpcial_file_dir) s1 = json.load(f_1) f_2 = file(newSpcial_file_dir) s2 = json.load(f_2)原创 2016-12-21 15:12:54 · 2805 阅读 · 0 评论 -
python通过正则表达式提取文本
第一种方式:eight_date = re.compile(r"正则式")str1 = re.search(eight_date, "文本内容").group(0)第二种方式:str1 = re.search(r"正则式","文本内容").group(0)原创 2017-08-02 15:06:07 · 13109 阅读 · 0 评论