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ファイルベースで名前を分離するコードを持っていますが、第二forloopは(JSONとの)第一ループの後ので、そのインデックスをリセットしていませんでしたforloopリストのうちの1つがスタックされました。答えのためののpythonのArrayList分布
はTNX。^^、私はすでに配列にobjをJSONを入力環境によって問題を解決