f.write("\n") f.close() print("non matches: " + str(len(search.non_matches))) f = open("output_non_matches.txt", "w") for non_match in search.non_matches: f.write(json.dumps(non_match.dict_without_tags())) f.write("\n") f.close() # verify solution to_verify_list = reader.read_json_list("correct_partial_solution.txt") products_expected = [] for item in to_verify_list: products_expected.append(item["product_name"]) expected_missing = [] for correct in products_expected: if correct not in key_list: expected_missing.append(correct) print("expected to be on output:") for error in expected_missing: print(error) non_expected_list = [] for o in key_list: