simple question select faces

Hello:) I have a really simple question.
How to select single face using python?

I can use code to vertices.['Mesh'].vertices[4*n].select=True['Mesh'].vertices[4*n+1].select=True['Mesh'].vertices[4*n+2].select=True['Mesh'].vertices[4*n+3].select=True

This not work good when i have faces which has got 3 vertices and faces where are 4 vertices.

Probably I can make that much simpler:)['Mesh'].faces[1]select=True

Doesn’t work and I do not know why.

Thanks for all answers:)

it’s called polygons now, not faces. make sure the object is not in edit mode, or your selection won’t happen.['Cube'].polygons[0].select = True
# or, currently selected object, in object mode again[0].select = True

when you then check in edit mode, the changes selection will show up.

or use bmesh module to select faces without switching from edit mode!

sorry, but where exactly on this page says how I can select faces using bmesh module? ive checked but i couldn’t find…

it’s the introduction to the bmesh module, if you click “bmesh.types”, you find the methods, e.g. select_set:

import bpy, bmesh

ob = bpy.context.object

if ob.mode == 'EDIT':
    bm = bmesh.from_edit_mesh(
    bm.select_mode = {'FACE'}

yes, I can manage the flag state with either select_set or .select, I ve seen them being changed over the terminal console.

But it doesn’t get updated on the scene somehow. .select or select_set works only with the python console, but not if it is written inside a script. Only the state of the flag is changed.

Or do I have to do every time I change the state?