Function that prints the location of all the vertices of an active object I want to write a function that prints the location of all of the vertices of an active object.
I have a Cube and I want to print out the location of the 8 vertices of the cube.
I started doing this but I dont really know what I am doing.
def printVertices() :
       Cube = bpy.context.active_object
       lemesh = obj.data
       print(lesmesh.vertices[0].co.x)
Assuming your object is selected, the following code should work:
import bpy

for vert in bpy.context.active_object.data.vertices:
    print (vert.co)

I will also point out blender has an integrated terminal where you can type incomplete python statements (e.g bpy.context.active_object.data.) and press tab in order to print a display of the possible completions. This is very useful to quickly navigate over the properties of bpy objects and gain quick intuition on what you can and can't do.