databasetools中加入从字典中提取题号的功能ExtractProblemIDs
This commit is contained in:
parent
62ca26bd0e
commit
d683ad00ce
|
|
@ -1330,5 +1330,20 @@ def getUnit(n): # 返回0-9的数字对应的单元名
|
||||||
if 0<=n<=9:
|
if 0<=n<=9:
|
||||||
return unitlist[n]
|
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__":
|
if __name__ == "__main__":
|
||||||
print("数据库工具, import用.")
|
print("数据库工具, import用.")
|
||||||
Reference in New Issue