diff options
-rwxr-xr-x | barcode_scanner_daemon.py | 5 |
1 files 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 |