How do I render specific render layers using python? Does anybody know how to choose one or more from multiple defined render layers by name from command line or from the blender python console? To disable all render layers except the ones specified.
Here's a little script, that iterates over all render layers and checks for some condition (e.g. does the layername start with 's'?). Then it disables all render layers and enables one that fulfills the condition until there are no more layers:

import bpy

render_layers = bpy.context.scene.render.layers

for layer in render_layers:

    # some condition
    if layer.name.startswith("s"):

        # disable all
        for l in render_layers:
            l.use = False

        # re-enable a single one that matched the condition
        layer.use = True

        # RENDER HERE