database_tools增加AppendTextFile功能
This commit is contained in:
parent
497c319ac9
commit
6367c617e7
|
|
@ -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())) #返回排序后的字典
|
||||
|
||||
|
|
|
|||
Reference in New Issue