Nope. Whenever I try to work from home, I work from a separate room, and close it - but then the room does not have an attached bathroom inside, and there are other things (water/food etc.) for which you have to come out - and once she knows I'm at home, she will bang the door every few minutes to come in, to talk or play with me.
This has to be a different strokes for different folks kind of situation (the modus operandi for parenting) but just in case you truly are in need of the answer: discipline.