Jul-31-2018, 05:48 PM
I want to iterate over a loop until an OSError is thrown. That's it. What's the best way to do that. What I'm doing is using
Just to show some code (this is not how I want to do it)
Help is, as always, much appreciated.
malonn
winreg.EnumKey
to make a list of all sub-keys of a key. The function returns one key at a time. So, I need to loop it, increasing the index each time to enum all keys. How do I stop the loop at an OSError (which is what the docs recommend)?Just to show some code (this is not how I want to do it)
i = 0 while i < 5: list = winreg.EnumKey(<key>, i) i += 1I want something like
while not OSError: ....But my limited understanding is causing errors.
Help is, as always, much appreciated.
malonn