diff --git a/工具v2/database_tools.py b/工具v2/database_tools.py index 69174997..e5b3515d 100644 --- a/工具v2/database_tools.py +++ b/工具v2/database_tools.py @@ -782,7 +782,7 @@ def GenerateTeacherBodyString(problems,sectiontitles,prodict,objdict,consecutive bodystring += sectionstring return bodystring #返回主题内容字符串 -def GetValidTexFiles(path): #获取有题号的.tex文件列表 及 有题号的.tex文件所在的路径列表 +def GetValidTexFiles(path): #获取 有题号的.tex文件列表 及 有题号的.tex文件所在的路径列表 texlist = [] pathlist = [] for root,folders,files in os.walk(path): @@ -793,9 +793,10 @@ def GetValidTexFiles(path): #获取有题号的.tex文件列表 及 有题号的 if len(ids) > 0: pathlist = pathlist + [root] texlist = texlist + [os.path.join(root,file)] - texlist = list(set(texlist)) - pathlist = list(set(pathlist)) + texlist = sorted(list(set(texlist))) + pathlist = sorted(list(set(pathlist))) return (texlist,pathlist) # 返回 有题号的.tex文件列表 与 所在路径列表 组成的二元组 + if __name__ == "__main__": print("数据库工具, import用.") \ No newline at end of file