diff options
Diffstat (limited to 'reversing_tools/abbott/freestyle_hid_console.py')
-rwxr-xr-x | reversing_tools/abbott/freestyle_hid_console.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/reversing_tools/abbott/freestyle_hid_console.py b/reversing_tools/abbott/freestyle_hid_console.py index 5acd958..908fb4e 100755 --- a/reversing_tools/abbott/freestyle_hid_console.py +++ b/reversing_tools/abbott/freestyle_hid_console.py @@ -4,6 +4,7 @@ import argparse import logging +import sys from glucometerutils import exceptions from glucometerutils.support import freestyle @@ -36,7 +37,12 @@ def main(): device.connect() while True: - command = input('>>> ') + if sys.stdin.isatty(): + command = input('>>> ') + else: + command = input() + print(f'>>> {command}') + try: print(device._send_text_command(bytes(command, 'ascii'))) except exceptions.InvalidResponse as error: |