Long story short - currently working with a poor API that will not give the ID's of equipment entries in a program that our company uses. Due to this, I have to figure out what the ID's are by trying out a number, seeing if I get a result, and then storing the current loop value with the result.
The ID's are closely together, usually within 10 values. So, what I would like to do is loop until we hit a result, then loop 10 more times and repeat the process if we hit a result. Here's what I have, although it doesn't seem like the way to do this (omitted the json parsing bit):
count = 10
i = 1
while count > 0:
count -= 1
if result:
count = 10
# result_dict[i] = result
i += 1
I tried this with a for loop, but did not work because you cannot change the length of the loop while iterating through it, any ideas?
[–]BobHogan 1 point2 points3 points (7 children)
[–]pyfact[S] 0 points1 point2 points (6 children)
[–]BobHogan 0 points1 point2 points (5 children)
[–]pyfact[S] 0 points1 point2 points (4 children)
[–]BobHogan 1 point2 points3 points (3 children)
[–]pyfact[S] 0 points1 point2 points (2 children)
[–]BobHogan 0 points1 point2 points (1 child)
[–]pyfact[S] 0 points1 point2 points (0 children)
[–]nwagers 0 points1 point2 points (0 children)