Set visible layers from script

Hi guys!

I know how to move objects to the layers I like. But in my script it would be convenient to also select the layers that should be visible in the image. Can I do that from a python script?

Thanks, jp.