BPY-API

Accessing data from the currently loaded blend file is done with the odule bpy.data
examples

========== step 1 ========
import bpy
print(list(bpy.data.objects))

bpy.data.objects[0] bpy.data.objects[“Cube”] ====================

bpy.context.object #- this gets the last object selected, not necessarily an actively selected obhect

========get the data block- see python tool tip on button==
bpy.ops.mesh.primitive_cube_add(enter_editmode=False, align=’WORLD’, location=(0, 0, 0), scale=(1, 1, 1))

==========================

==========================

bmesh
newer video
old video