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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user