I would like to ask how to insert i2 into i1 under the condition below.
It can print numbers sequentially from 0 to A. But i got little problem, about facing an issue where it only prints the number A repeatedly. Is there any way to fix this?
Image:
Left: result i want.
Right: result i got.
Image
for i2 in range(record_len_id+1): #0 ~ A
name = i2
print(name)
for i1 in range(num_records): ##0 ~ B
name1 = i1
this_record = read_data(binary_data, record_len, data_start_point + i1 * record_len)
MergeFull = ""
if read_int(this_record, 0) == 417:
MergeFull = "======n{}n".format(i2) #Condition Here!!!!!!
MergeFull += "Debug2: {} | ".format(read_int(this_record, 4))
output_file.write(str(MergeFull)+"n")