diff options
| author | xengineering <mail2xengineering@protonmail.com> | 2020-10-19 17:22:08 +0200 |
|---|---|---|
| committer | xengineering <mail2xengineering@protonmail.com> | 2020-10-19 17:22:08 +0200 |
| commit | dd41aae7363672316851ebbd35961ae2bc89ff4c (patch) | |
| tree | d49971933ec11cc7b0e07898a35888a26d1f012d | |
| parent | cb0c3892122b054c58b9bc5836608ba6ba0e5ca9 (diff) | |
| download | iot-barcode-scanner-dd41aae7363672316851ebbd35961ae2bc89ff4c.tar iot-barcode-scanner-dd41aae7363672316851ebbd35961ae2bc89ff4c.tar.zst iot-barcode-scanner-dd41aae7363672316851ebbd35961ae2bc89ff4c.zip | |
Bugfix for Raspberry Pi
| -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 |
