The way I would do this is write your script using a step based approach. In each step of your script, you would write the current step to the datalayer. You would read the last step reached in the script at the start of the script execution. This way you can skip to the previous location in the script, in the case of an error, when you execute the script again. You would also need a function to reset the step in the datalayer in the case that you don't want to resume but restart.
The Python Runtime is not a state machine in itself, so this needs to be programmed.
... View more