Print running dataset count after each received record in client.py

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-25 21:25:34 +02:00
co-authored by Claude Sonnet 4.6
parent 9d2d742368
commit d94df87443
+3 -1
View File
@@ -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: