一些常用功能
打开json:
1 | with open(jsonfile, 'r', encoding='utf8')as f: |
输出到json:
1 | with open(jsonoutfile, 'a', encoding='utf8')as fp: |
1 | cvedatas = [] |
遍历目录:
1 | files = os.listdir(cacheDirPath) |
翻译有道:
1 | def get_translate_youdao(word): |
根据正则匹配内容修改文件:
1 | tem1 = 'script_template("FullScan"' |
不区分大小写匹配两个字符串:
1 | for key in databasekey: |