2023继续教育考试答案
import re,sys,time,sys,os,json #abc='' ax=0 abc=abc.replace('\n','').replace('\r\n','') abd=abd.replace('\n','').replace('\r\n','') abe=abe.replace('\n','').replace('\r\n','') aa=json.loads(abc) ab=json.loads(abd) ac=json.loads(abe) #sys.exit(0) ##aca=aa[0]["paperQuestionRPS"] ##acb=ab[0]["paperQuestionRPS"] ##acc=aa[0]["paperQuestionRPS"] with open("aax1.txt","w") as f: f.write("a1\n") for ii in aa: ax=ax+1 tigan=ii["questionName"] f.write("\n"+str(ax)+" ") f.write(tigan+"\n") mcu=ii['paperOptionRPS'] duu="" for iv in mcu: daa=iv["context"] dab=iv["standardAnswer"] #f.write(daa+"\n") if dab==1: duu=duu+"\n"+daa f.write("答案:"+"\n"+duu) f.write("\na2\n") for ii in ab: ax=ax+1 tigan=ii["questionName"] f.write("\n"+str(ax)+" ") f.write(tigan+"\n") mcu=ii['paperOptionRPS'] duu="" for iv in mcu: daa=iv["context"] dab=iv["standardAnswer"] #f.write(daa+"\n") if dab==1: duu=duu+"\n"+daa f.write("答案:"+"\n"+duu) f.write("\na3\n") for ii in ac: ax=ax+1 tigan=ii["questionName"] f.write("\n"+str(ax)+" ") f.write(tigan+"\n") mcu=ii['paperOptionRPS'] duu="" for iv in mcu: daa=iv["context"] dab=iv["standardAnswer"] #f.write(daa+"\n") if dab==1: duu=duu+"\n"+daa f.write("答案:"+"\n"+duu)