My program has the following scturcutre
There are around 20 additional conditions and whenever one of them is not met, the program should return to the starting point. With a goto statement this could be easily solved. However, in Python this is not an option. Any suggestions are appreciated how this can be implemented elegantly.
You should give us the code, or at least an example showing what the structure really is.
Maybe you could do so:
take screenshot
condition = (condition a) and (condition b) and ... and (condition z)
while (not condition):
take screenshot
condition = (condition a) and (condition b) and ... and (condition z)