[script] extract vertices, face (vert index), and normals of the faces

i’m new to python, nut not to programming.
i have many difficulties looknig at the documentation.
i’m trying to make a simple script that prints vertices, face index, and normals of the

for f in face

but this leads to this error: MeshFace object has no attributre ‘verts’…
looking here:
i’m not seeing anything, perhaps i’m looking at the wrong page
in an old documentation:
seems that verts is a property of MFace
i really don’t know where to find the right reference and how to search it…
can someone point me to the right direction?

assuming you are running this code in some recent version of blender (2.58…)
(but the error message looks like it’s being run in a 2.49 version or something, so the following code will be of no use to you)

your for loop misses a colon. i’ve written at length about this kind of stuff:

  1. blenderscripting.blogspot.com/python-printing-vertex
  2. blenderscripting.blogspot.com/search/label/Faces

with one face selected, in editmode… go to object mode and run this in the console

import bpy

current_object = bpy.context.active_object
selected_faces = [face for face in current_object.data.faces if face.select]

# shows you what you can do with 'selected_faces'

# print the normal of the first item in selected faces

thanks, i’ll try
my version is 2.57.1r36339

tryied all ok.
but can be automated the print of normals as the faces and vertex?
or should i select a face and run the script every time?

there is no pre written function that i know of in bpy that does that, but i would use something like :

import bpy

current_obj = bpy.context.active_object

print("="*40) # printing marker
for face in current_obj.data.faces:
    verts_in_face = face.vertices[:]
    print("face index", face.index)
    print("normal", face.normal)
    for vert in verts_in_face:
        print("vert", vert, " vert co", current_obj.data.vertices[vert].co)

you are very expert!
thank you!!!