0
def createlist(json, filename, arraygroup):
filehdl = open(filename, "wb")
for key, value in rulegroup.items():
filehdl.write('#' + value + "\n")
for list in json:
if list['arraygroup'] == value:
filehdl.write(list['name'] + " " + list['surname'] + "\n")
filehdl.close()
#depart1
testname testsurname
testname1 testsurname2
testname3 testsurname3
#depart2
#depart3
Json has 5 names, and 2 names should be places in #depart2, #depart3 base on their correct department.
嗨,我在这里,这将创建一个文件,并在那里组JSON文件的基础名称分离的代码,但第二个for循环(使用JSON)第一环后不进行重置其索引,所以的forloop名单卡住了。蟒蛇ArrayList的分布
TNX的答案。^^,