From e9094f8f226e8f10d7c1bfe3cdb339fded36068b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com> Date: Thu, 19 May 2016 18:10:17 -0400 Subject: [PATCH] README: fix python example --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index bc590499..af20bd71 100644 --- a/README.md +++ b/README.md @@ -70,17 +70,17 @@ int main() ```python import opendht as dht -r = dht.DhtRunner() -r.run() +node = dht.DhtRunner() +node.run() # Join the network through any running node, # here using a known bootstrap node. -r.bootstrap("bootstrap.ring.cx", "4222") - -r.put(dht.InfoHash.get("unique_key"), dht.Value(b'some binary data')) +node.bootstrap("bootstrap.ring.cx", "4222") # 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: print(r) ``` -- GitLab