Skip to content
Snippets Groups Projects
Commit e9094f8f authored by Adrien Béraud's avatar Adrien Béraud
Browse files

README: fix python example

parent ff2193dc
No related branches found
No related tags found
No related merge requests found
...@@ -70,17 +70,17 @@ int main() ...@@ -70,17 +70,17 @@ int main()
```python ```python
import opendht as dht import opendht as dht
r = dht.DhtRunner() node = dht.DhtRunner()
r.run() node.run()
# Join the network through any running node, # Join the network through any running node,
# here using a known bootstrap node. # here using a known bootstrap node.
r.bootstrap("bootstrap.ring.cx", "4222") node.bootstrap("bootstrap.ring.cx", "4222")
r.put(dht.InfoHash.get("unique_key"), dht.Value(b'some binary data'))
# blocking call (provide callback arguments to make the call non-blocking) # blocking call (provide callback arguments to make the call non-blocking)
results = r.get(dht.InfoHash.get("unique_key")) node.put(dht.InfoHash.get("unique_key"), dht.Value(b'some binary data'))
results = node.get(dht.InfoHash.get("unique_key"))
for r in results: for r in results:
print(r) print(r)
``` ```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment