What is the simplest way to turn off all but one layer in python I have a simple python script where i am importing many files and placing them in layers. But when I turn on another layer, the previous ones remain on.

What is the simplest way to turn off all but one specific layer via python, preferably through bpy.data.scenes instead of bpy.ops
not sure how terse you want this ;)

bpy.context.scene.layers = [i == 6 for i in range(20)]


The layer with index 6 will be flipped on, the others off.