Skip to content

Commit

Permalink
update first-app to be in line with current python api
Browse files Browse the repository at this point in the history
  • Loading branch information
mmrrqq committed Oct 21, 2024
1 parent b438700 commit 2ad310b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions content/docs/getting-started/first-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Now we need a subscriber, `z_subscriber.py` that can receive the measurements:
import zenoh, time

def listener(sample):
print(f"Received {sample.kind} ('{sample.key_expr}': '{sample.payload.deserialize(str)}')")
print(f"Received {sample.kind} ('{sample.key_expr}': '{sample.payload.to_string()}')")

if __name__ == "__main__":
session = zenoh.open(zenoh.Config())
Expand Down Expand Up @@ -119,10 +119,10 @@ if __name__ == "__main__":
for reply in replies:
try:
print("Received ('{}': '{}')"
.format(reply.ok.key_expr, reply.ok.payload.deserialize(str)))
.format(reply.ok.key_expr, reply.ok.payload.to_string()))
except:
print("Received (ERROR: '{}')"
.format(reply.err.payload.decode(str)))
.format(reply.err.payload.to_string()))

session.close()
```
Expand Down

0 comments on commit 2ad310b

Please sign in to comment.