title: How to connect to memcachedb and use API
body: <p>I have installed <a href="http://memcachedb.org/" rel="nofollow noreferrer">memcachedb</a> according to the <a href="http://memcachedb.org/memcachedb-guide-1.0.pdf" rel="nofollow noreferrer">Memcachedb: The complete guide</a>, and I am able to set and get the key,values using telnet as explained in the guide.</p>
  <p>What I really want to do is to set and get the key, value pairs from a python script.</p>
  <p>I have the memcachedb running on the Ubuntu machine by following command:</p>
  <blockquote>
  <p>sudo ./memcachedb -vv -u root -H ~/mcDB/ -N</p>
  </blockquote>
  <p>I read and found out that libmemcached python client can be used to communicate with memcachedb.
  So, I am using the following test script</p>
  <pre><code>import memcache
  
  client=memcache.Client([('localhost',21201)]) # port for memcachedb
  
  print &quot;return value  &quot; + str(client.set(&quot;key&quot;,&quot;value&quot;))
  
  print &quot;get result  &quot; + str(client.get(&quot;key&quot;))
  </code></pre>
  <p>But it gives the following output:</p>
  <blockquote>
  <p>return value  0</p>
  <p>get result  None</p>
  </blockquote>
  <p>I have also tried replacing localhost with 127.0.0.1, does not work either.</p>
  <p>In fact, there is no output by memcachedb (-vv option) on running the python script while there is when I use telnet to set and get.</p>
  <p>So how can I connect to memcachedb and execute commands through python (get and set)?</p>