beginner using v2.81 basic script format error please help (creating poses) compile error
Use bpy.context.object instead of bpy.context.scene.objects.active that does not work in 2.8x. 

Works fine in 2.81: