Can you switch layers on and off in realtime???

I was wondering if its possible to switch layers off and on in realtime using python? I find working with scenes very difficult and am looking for an alternative.