How do I Include scene.camera name in render output filepath?
the script automatically creates the directories with your cams names. If it is already there, the script just puts the animated pics in these folders.
check this out:
import bpy
import os

scene = bpy.context.scene

oldPath = bpy.context.scene.render.filepath

for ob in scene.objects:
    if ob.type == 'CAMERA':
        bpy.context.scene.camera = ob
       
        filepath = bpy.context.scene.render.filepath
       
#        filepath = bpy.data.filepath # blend file
        directory = os.path.dirname(filepath)
       
        name = ob.name + &quot;/&quot;

        directory_to_test = os.path.join(filepath, name)

        if not os.path.exists(directory_to_test):
            os.makedirs(directory_to_test)
            print(&quot;created directory: &quot;, directory_to_test)
            
        file = directory_to_test + &quot;render&quot;
            
        bpy.context.scene.render.filepath = file
        
#        bpy.ops.render.render( write_still=True )
        
        bpy.ops.render.render(animation=True) 
        
        bpy.context.scene.render.filepath = oldPath