Skip to content

Commit

Permalink
deploy: 0cddaf8
Browse files Browse the repository at this point in the history
  • Loading branch information
Mallets committed Nov 12, 2024
1 parent cece726 commit 49b851e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/getting-started/first-app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</span></span></code></pre></div><p>Now we need a subscriber, <code>z_subscriber.py</code> that can receive the measurements:</p><div class=highlight><pre tabindex=0 style=background-color:#f0f3f3;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-python data-lang=python><span style=display:flex><span><span style=color:#069;font-weight:700>import</span> <span style=color:#0cf;font-weight:700>zenoh</span><span style=color:#555>,</span> <span style=color:#0cf;font-weight:700>time</span>
</span></span><span style=display:flex><span>
</span></span><span style=display:flex><span><span style=color:#069;font-weight:700>def</span> <span style=color:#c0f>listener</span>(sample):
</span></span><span style=display:flex><span> <span style=color:#366>print</span>(<span style=color:#c30>f</span><span style=color:#c30>&#34;Received </span><span style=color:#a00>{</span>sample<span style=color:#555>.</span>kind<span style=color:#a00>}</span><span style=color:#c30> (&#39;</span><span style=color:#a00>{</span>sample<span style=color:#555>.</span>key_expr<span style=color:#a00>}</span><span style=color:#c30>&#39;: &#39;</span><span style=color:#a00>{</span>sample<span style=color:#555>.</span>payload<span style=color:#555>.</span>deserialize(<span style=color:#366>str</span>)<span style=color:#a00>}</span><span style=color:#c30>&#39;)&#34;</span>)
</span></span><span style=display:flex><span> <span style=color:#366>print</span>(<span style=color:#c30>f</span><span style=color:#c30>&#34;Received </span><span style=color:#a00>{</span>sample<span style=color:#555>.</span>kind<span style=color:#a00>}</span><span style=color:#c30> (&#39;</span><span style=color:#a00>{</span>sample<span style=color:#555>.</span>key_expr<span style=color:#a00>}</span><span style=color:#c30>&#39;: &#39;</span><span style=color:#a00>{</span>sample<span style=color:#555>.</span>payload<span style=color:#555>.</span>to_string()<span style=color:#a00>}</span><span style=color:#c30>&#39;)&#34;</span>)
</span></span><span style=display:flex><span>
</span></span><span style=display:flex><span><span style=color:#069;font-weight:700>if</span> __name__ <span style=color:#555>==</span> <span style=color:#c30>&#34;__main__&#34;</span>:
</span></span><span style=display:flex><span> session <span style=color:#555>=</span> zenoh<span style=color:#555>.</span>open(zenoh<span style=color:#555>.</span>Config())
Expand Down

0 comments on commit 49b851e

Please sign in to comment.