diff --git a/python/cat.py b/python/cat.py new file mode 100644 index 0000000000000000000000000000000000000000..87a9933c648bf4473166822ee978c6cc9d4232f4 --- /dev/null +++ b/python/cat.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python + +import sys +import client + +# read lines from stdin and write them to the display. +# includes scrolling. +# FIXME: scrolling is slow. use a pixel buffer and blitting. +if __name__ == "__main__": + y = 0 + lines = [] + line = sys.stdin.readline() + while(line != ""): + client.write(0, y, line) + lines.append(line) + if(y == client.NUM_SEG_Y): + lines.reverse() + lines.pop() + lines.reverse() + y = 0 + for l in lines: + client.write(0, y, l) + y += 1 + else: + y += 1 + line = sys.stdin.readline() +