diff --git a/工具v2/database_tools.py b/工具v2/database_tools.py index fff6efb5..366b3843 100644 --- a/工具v2/database_tools.py +++ b/工具v2/database_tools.py @@ -24,6 +24,11 @@ def SaveTextFile(data,filepath): #写入文本格式的文件 f.write(data) return filepath #返回文件名 +def AppendTextFile(string,filepath): #在文本文件后添加内容 + with open(filepath,"a",encoding = "u8") as f: + f.write(string.strip()+"\n\n") + return filepath #返回文件名 + def SortDict(adict): #按字典项顺序排序字典 return dict(sorted(adict.items())) #返回排序后的字典