Blender python screenshot wait
OK so in my case putting
bpy.ops.wm.redraw( type=&quot;DRAW_WUN_SWAP&quot;, iterations=1) worked... Before I took the screen shot in code.
Got the info from here Update viewport while running script