What interests me is basically to stop the execution of my code until the end of the render but at the same time view the progress of the render, considering that the possibility of the "ESC" key that cancels the render. I am looking on the internet but the situation is unclear to me, I found this:
but it seems quite complicated, I was wondering if there was a simpler solution to my specific case, as my situation is slightly different, as I don't want to render multiple.
Practically:
## my code
## my code
bpy.ops.render.render('INVOKE_DEFAULT', animation = False, write_still = True)
## if render is done:
###### my code
###### my code
bpy.app.handlers.render_post
orbpy.app.handlers.render_complete
as shown in the answer you've linked. Once the render is finished the function will be executed. $\endgroup$