import bpy
destfolder = "C:\\Users\\username\\Desktop"
sce = bpy.data.scenes['Scene']
for ob in sce.objects:
bpy.ops.object.select_pattern(pattern = ob.name)
bpy.ops.export_scene.obj(filepath = destfolder + ob.name + ".obj", use_selection = True)
aW1wb3J0IGJweQoKZGVzdGZvbGRlciA9ICJDOlxcVXNlcnNcXHVzZXJuYW1lXFxEZXNrdG9wIgoKc2NlID0gYnB5LmRhdGEuc2NlbmVzWydTY2VuZSddCmZvciBvYiBpbiBzY2Uub2JqZWN0czoKICAgIGJweS5vcHMub2JqZWN0LnNlbGVjdF9wYXR0ZXJuKHBhdHRlcm4gPSBvYi5uYW1lKQogICAgYnB5Lm9wcy5leHBvcnRfc2NlbmUub2JqKGZpbGVwYXRoID0gZGVzdGZvbGRlciArIG9iLm5hbWUgKyAiLm9iaiIsIHVzZV9zZWxlY3Rpb24gPSBUcnVlKQoK