Activate face by script I want to activate the biggest face by a script.
It's no problem to locate and get the data, but how can I activate it in Editor? 

# Activate biggest face exclusivly:
import bpy
import operator

# List of Polygons of (first) selected object: 
pgList = bpy.context.selected_objects[0].data.polygons

# sort and get biggest face:
pgMax = sorted(pgList, key=operator.attrgetter('area'), reverse=True)[0]
print("{0:} Polygons, largest = {1:.2f},   selected = {2:}".format(len(pgList),pgMax.area,pgMax.select))

# How do I activate this Polygon?
# The results are very random. Sometimes selected, sometimes not, sometimes Blender chrashes.
bpy.ops.object.mode_set(mode = 'EDIT')
bpy.ops.mesh.select_all(action='DESELECT')
bpy.ops.object.mode_set(mode = 'OBJECT')
pgMax.select=True
bpy.ops.object.mode_set(mode = 'EDIT')

#Later i'ld like to create a TransformOrientationSystem. But this will be next problem.
#pgMax ....  .transform.create_orientation(use=True)
# erzeuge dazu ein lokales Bezugssystem

```
Set the active face

To set the active face 

me.polygons.active = &lt;index of face&gt;


or via bmesh

bm.faces.active = &lt;BMFace&gt;


Bmesh

Can use bmesh  in edit mode, bound to the object being edited. Takes away the need to toggle modes

Notice I set the mode to face.  Otherwise would need to flush the selection.

import bpy
import bmesh
context = bpy.context

context.tool_settings.mesh_select_mode = (False, False, True) # faces
ob = context.edit_object
me = ob.data

bm = bmesh.from_edit_mesh(me)

faces = sorted(bm.faces, key=lambda f:f.calc_area())
bf = faces.pop()
bf.select = True
for f in faces:
    f.select = False
bm.faces.active = bf
bmesh.update_edit_mesh(me)


In object mode can set all to false by looping or via 

import bpy
context = bpy.context
context.tool_settings.mesh_select_mode = (False, False, True) # faces
# deselect all polygons

ob = context.object
me = ob.data
all_false  = [False] * len(me.polygons)
mp = sorted(me.polygons, key=lambda p: p.area).pop()
me.polygons.foreach_set("select", all_false)
mp.select = True
me.polygons.active = mp.index


set random active face in python without toggle mode

Is the active object and zeroth selected object always the same?