can any of these lines be made to work?

blender -P bad_code.txt.

Blender 2.72b made these python 3.4.2 lines.

How to make some lines work?

#start.
bpy.context.area.type = ‘VIEW_3D’

AttributeError: ‘NoneType’ object has no attribute ‘type’

unselect “limit selection to visible”.

bpy.context.space_data.use_occlude_geometry = False

AttributeError: ‘NoneType’ object has no attribute ‘use_occlude_geometry’

mark 3d cursor location. (“x: 0.5”) (“y: 0”) (“z: 2”)

bpy.context.space_data.cursor_location[0] = 0.5
bpy.context.space_data.cursor_location[1] = 0
bpy.context.space_data.cursor_location[2] = 2

AttributeError: ‘NoneType’ object has no attribute ‘cursor_location’

reset extrude region panel.

bpy.data.window_managers[“WinMan”].(null)[0] = False
bpy.data.window_managers[“WinMan”].(null)[1] = False
bpy.data.window_managers[“WinMan”].(null)[2] = False

SyntaxError: invalid syntax

extrude from cube. (“x: 1.5”) (“y: 0”) (“z: 0”)

bpy.data.window_managers[“WinMan”].(null)[0] = 1.5

SyntaxError: invalid syntax

material. navigate to color.

bpy.context.area.type = ‘PROPERTIES’

AttributeError: ‘NoneType’ object has no attribute ‘type’

material. navigate to color.

bpy.context.space_data.context = ‘MATERIAL’

AttributeError: ‘NoneType’ object has no attribute ‘context’

adjust color red.

bpy.context.object.active_material.diffuse_color[0] = 0.716
AttributeError: ‘NoneType’ object has no attribute ‘diffuse_color’

adjust color green.

bpy.context.object.active_material.diffuse_color[1] = 0.352

AttributeError: ‘NoneType’ object has no attribute ‘diffuse_color’

adjust color blue.

bpy.context.object.active_material.diffuse_color[2] = 0.178

AttributeError: ‘NoneType’ object has no attribute ‘diffuse_color’

adjust color red, green, blue.

bpy.context.object.active_material.diffuse_color = (0.716, 0.352, 0.178)

AttributeError: ‘NoneType’ object has no attribute ‘diffuse_color’

bpy.context.object.active_material.specular_intensity = 0.05

AttributeError: ‘NoneType’ object has no attribute ‘specular_intensity’

Add bone. Must be in edit mode.

bpy.ops.object.armature_add()

RuntimeError: Operator bpy.ops.object.armature_add.poll() failed, context is incorrect

add bone.

bpy.context.object.data.edit_bones[“Bone”].head = Vector((1.0, 2.0, 3.0))

NameError: name ‘Vector’ is not defined

add bone.

bpy.context.object.data.edit_bones[“Bone”].head

AttributeError: ‘Mesh’ object has no attribute ‘edit_bones’