diff --git a/client.py b/client.py index 909ef4b..0dbb299 100644 --- a/client.py +++ b/client.py @@ -35,6 +35,7 @@ def main() -> None: print("Connected. Waiting for data (Ctrl-C to quit).\n", flush=True) buf = "" + count = 0 try: with sock: while True: @@ -50,8 +51,9 @@ def main() -> None: continue try: data = json.loads(line) + count += 1 print(json.dumps(data, indent=2)) - print("-" * 60, flush=True) + print(f"--- #{count} ", "-" * 50, flush=True) except json.JSONDecodeError as e: print(f"[invalid JSON] {e}: {line!r}", file=sys.stderr) except KeyboardInterrupt: