I have a python script that does the following task. It does a for loop to go through the array items and gives relevant information belonging to that item.
I want to update the array in real-time and also the for loop must be executed without resetting. Some ML training happens inside the for loop so it should not be restarted whenever the array get updated. At the same time the for loop must be able to detect the appended items in the array.
'''
arr = [a,b,c]
for i in arr:
print(i) #and do something
Now basically the arr will be appended by listening to a DB column. For instance, i do
arr.append(dbData)
I know I can use the function to call the for loop again, but how to do it without having to reset the loop?
Thank you for your help. Kindly let me know if the question is unclear.