As a bodge, I have used a plastic ruler. Lay it flat on the carpet, right up against the skirting board, bear down on it with one hand, while painting the bottom edge with the other. As I say, it is a bodge, but it's worked for me. I may regret it later, if I ever decide to remove the carpet and replace it with something shallower.
BTW. I don't do painting professionaly, so no customer was ripped off by this shoddy practice.