How to Separate Mesh by “Loose Parts” through Python API?

I would like to automate the process of modifying a .fbx file but I'm not quite sure why my code isn't working. All I'm doing is importing a .fbx file, separating the mesh by "Loose Parts", and then exporting it back out. Any thoughts?

import bpy


• You want to separate objects['Plane'] only? Did the imported fbx named 'Plane'? And are you use version 2.79 and below? – HikariTW Jul 22 at 1:33
• If you're using newer Blender (2.80 and above) I don't think buildings.select = True will be able to run. You should use buildings.select_set(True) instead – HikariTW Jul 22 at 14:39