Post #4483: 
So the answer at the end is just to google it, but you need to have some idea of python to know what you are looking for.
for example: ‘blender python edit mode’ leads us to a blender stackexchange post that has:
import bpy
for obj in bpy.data.objects:
if obj.name[0:4] == "Text" and obj.type == "MESH":
bpy.context.scene.objects.active = obj
bpy.ops.object.mode_set(mode = 'EDIT')
print(bpy.context.mode)
#bpy.ops.mesh.select_all(action = 'SELECT')
#print(bpy.ops.mesh.remove_doubles(0.0001))
bpy.ops.object.mode_set(mode = 'OBJECT')
What you need would be:
bpy.ops.object.mode_set(mode = 'EDIT')
bpy.ops.object.mode_set(mode = 'OBJECT')
To get a specific mode, and since its an operator pie menu should also give you more options
❤️ 2 likes

image694×258 24.1 KB