Software Pulse Width Modulation in Python