Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Terminate for loop in console
#7
IIRC, "pass" is used to replace a piece of code that is usually syntactically required, but for some reason or another, there is no instruction to give in practice. So "pass" is just telling the interpreter to run the next line of code instead. Like playing a game and choosing to skip your move. Break might be what you want instead to stop a loop. But in general, this is a recursion problem. For loops are a recursion, but they're really nice in that they often have terminal conditions built in, unlike while loops. ie,

Code:
for i in range(10):
   i += 1
print(i)


This has a terminal case, the result of that code will print the integer "9". The range function in the for loop gives an exact number of times the recursion is to be called.

I don't what the pdb.gimp_image_delete(x) method does, but if it modifies the list in any way per iteration, that might be something to keep an eye on.


You might be getting a recursion without a well-defined terminal condition, where the computer knows it needs to stop upon reaching some condition. If that list doesn't reach a defined terminal condition, it won't terminate. No promises, but I hope that helps
Reply


Messages In This Thread
Terminate for loop in console - by pwiecek56 - 07-04-2023, 03:55 PM
RE: Terminate for loop in console - by PixLab - 07-05-2023, 02:24 AM
RE: Terminate for loop in console - by pwiecek56 - 07-05-2023, 06:59 AM
RE: Terminate for loop in console - by Ofnuts - 07-05-2023, 07:00 PM
RE: Terminate for loop in console - by Dogarithm - 12-16-2023, 01:05 AM
RE: Terminate for loop in console - by Ofnuts - 12-16-2023, 09:40 AM
RE: Terminate for loop in console - by Ofnuts - 07-05-2023, 07:04 AM
RE: Terminate for loop in console - by pwiecek56 - 07-05-2023, 06:17 PM

Forum Jump: