New Problem - Scripting SOLIDIFY modifier not working

Here’s the code:

(It’s the NOT Working part)

I get an error message of white text on a gray background that scrolls beyond my ability to read it
and won’t let me copy / paste it or I would’ve included it here.



import bpy

bpy.ops.mesh.primitive_cube_add()
bpy.ops.object.editmode_toggle()
bpy.ops.mesh.poke()
bpy.ops.mesh.select_all(action='TOGGLE')
bpy.ops.mesh.edges_select_sharp()
bpy.ops.mesh.select_all(action='INVERT')

bpy.ops.mesh.select_similar(type='FACE', threshold=0.01)
bpy.ops.transform.resize(value=(3.53695, 3.53695, 3.53695), constraint_axis=(False, False, False), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1)
bpy.ops.mesh.select_all(action='TOGGLE')
bpy.ops.mesh.select_all(action='TOGGLE')
bpy.ops.mesh.inset(thickness=0.291296, use_individual=True)
bpy.ops.mesh.delete(type='FACE')
bpy.ops.object.editmode_toggle()



# NOT Working Below this line (Verbatim from Info Panel)

bpy.context.space_data.context = 'MODIFIER'
bpy.ops.object.modifier_add(type='SOLIDIFY')
bpy.context.object.modifiers["Solidify"].use.even_offset = True
bpy.context.object.modifiers["Solidify"].offset = 0
bpy.context.object.modifiers["Solidify"].thickness = -0.134
bpy.ops.object.modifier_apply(apply_as='DATA', modifier="Solidify")

I’m not sure what

bpy.context.space_data.context = 'MODIFIER'

is supposed to do, but it will cause an error. Also change

bpy.context.object.modifiers["Solidify"].use.even_offset = True

to

bpy.context.object.modifiers["Solidify"].use_even_offset = True

You can check errors by starting blender in the terminal (linux and mac) and checking the terminal,
or you can check the console on windows by going to Window > Toggle System Console