import bpy
destfolder = "d:\\test\\"
sce = bpy.data.scenes['Scene']
for ob in sce.objects:
if ob.select_get():
bpy.ops.object.select_pattern(pattern = ob.name)
bpy.ops.export_scene.obj(filepath = destfolder + ob.name + ".obj", use_selection = True)
aW1wb3J0IGJweQogCmRlc3Rmb2xkZXIgPSAiZDpcXHRlc3RcXCIKIApzY2UgPSBicHkuZGF0YS5zY2VuZXNbJ1NjZW5lJ10KZm9yIG9iIGluIHNjZS5vYmplY3RzOgogICAgaWYgb2Iuc2VsZWN0X2dldCgpOgogICAgICAgIGJweS5vcHMub2JqZWN0LnNlbGVjdF9wYXR0ZXJuKHBhdHRlcm4gPSBvYi5uYW1lKQogICAgICAgIGJweS5vcHMuZXhwb3J0X3NjZW5lLm9iaihmaWxlcGF0aCA9IGRlc3Rmb2xkZXIgKyBvYi5uYW1lICsgIi5vYmoiLCB1c2Vfc2VsZWN0aW9uID0gVHJ1ZSkKICAgICAgICA=