From dd41aae7363672316851ebbd35961ae2bc89ff4c Mon Sep 17 00:00:00 2001 From: xengineering Date: Mon, 19 Oct 2020 17:22:08 +0200 Subject: Bugfix for Raspberry Pi --- barcode_scanner_daemon.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/barcode_scanner_daemon.py b/barcode_scanner_daemon.py index 38f0514..09139f7 100755 --- a/barcode_scanner_daemon.py +++ b/barcode_scanner_daemon.py @@ -28,8 +28,9 @@ def main(): if event.type == evdev.ecodes.EV_KEY: eventdata = evdev.categorize(event) if eventdata.keystate: - with open(fifo_path, "a") as fifo: - fifo.append(eventdata.keycode) + with open(fifo_path, "w") as fifo: + fifo.write(eventdata.keycode) + fifo.flush() except KeyboardInterrupt: pass -- cgit v1.2.3-70-g09d2