Implementing a multivibrator function with python

Terry Reedy tjreedy at udel.edu
Mon Nov 11 05:58:18 EST 2013


On 11/11/2013 4:41 AM, JL wrote:
> I am trying to implement a multivibrator function with python. This is how it works;
>
> - An trigger event happens
> - Upon receiving the event, a variable goes high for 5secs, then go low.
> - If the event happens again before the 5secs expire, the high duration will be extended by another 5 secs. This works like a retriggerable multivibrator for those who are into electronics.
>
> Is there some sample code for this problem or can someone point me to using the right library for this feature?

Python 3.4 will have a new asyncio package that includes an event loop 
module. It will be in the forthcoming 3.4.b0 release; it might be in 
3.4.a4 but I have not installed that yet. In any case, I believe it 
should make the above easy.

-- 
Terry Jan Reedy




More information about the Python-list mailing list