databasetools中加入从字典中提取题号的功能ExtractProblemIDs
This commit is contained in:
parent
62ca26bd0e
commit
d683ad00ce
|
|
@ -1329,6 +1329,21 @@ def getUnit(n): # 返回0-9的数字对应的单元名
|
|||
unitlist = ["暂无对应","第一单元","第二单元","第三单元","第四单元","第五单元","第六单元","第七单元","第八单元","第九单元"]
|
||||
if 0<=n<=9:
|
||||
return unitlist[n]
|
||||
|
||||
def ExtractProblemIDs(paperdict,pro_dict):#从备课组材料的每一张讲义的dict(paperdict)中提取题号
|
||||
output = []
|
||||
for key in paperdict.keys():
|
||||
if type(paperdict[key]) == list:
|
||||
suslist = paperdict[key]
|
||||
flag = True
|
||||
for id in suslist:
|
||||
if not id in pro_dict:
|
||||
flag = False
|
||||
break
|
||||
if flag:
|
||||
for id in suslist:
|
||||
output.append(id)
|
||||
return(output)
|
||||
|
||||
if __name__ == "__main__":
|
||||
print("数据库工具, import用.")
|
||||
Reference in New Issue