Posted in August 2013

Clear sys.stdin Buffer

With epoll() it is possible to detect whether sys.stdin (the standard input character stream) is readable (i.e. someone typed something and concluded with <enter>). Standard input then can be obtained by calling sys.stdin.readline(). But it is not that trivial to get the last input line because sys.stdin is buffered. The user might have entered some … Continue reading

Python Bindings for timerfd.h

For my PhD thesis I’m working on event based control systems. Asynchronous I/O is needed, and so I rely on epoll(), a notification mechanism for file descriptors in Linux systems. As (nearly) everything in Linux can be described as a file, epoll() is able to monitor various I/O interfaces like GPIO or network sockets. It’s … Continue reading