From a77f3b871c14ef50a0b13ad0e059fd0c8320e28f Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 13 Jun 2013 11:49:48 +0200 Subject: minor improvement with flush MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- unstickpixels | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/unstickpixels b/unstickpixels index 0c4ad91..2068ea8 100755 --- a/unstickpixels +++ b/unstickpixels @@ -24,6 +24,7 @@ from subprocess import Popen, PIPE def print(text, end = '\n'): sys.stdout.buffer.write((text + end).encode('utf-8')) + sys.stdout.buffer.flush() (height, width) = Popen(['stty', 'size'], stdout=PIPE).communicate()[0].decode('utf-8', 'replace').split(' ') @@ -56,8 +57,11 @@ try: print('\033[H', '') while True: sys.stdout.buffer.write('\033]P0FF0000\033[2J'.encode('utf-8')) + sys.stdout.buffer.flush() sys.stdout.buffer.write('\033]P000FF00\033[2J'.encode('utf-8')) + sys.stdout.buffer.flush() sys.stdout.buffer.write('\033]P00000FF\033[2J'.encode('utf-8')) + sys.stdout.buffer.flush() except: pass if started: -- cgit v1.2.3-70-g09d2