import memcache mc memcache Client 127 11211 debug mc set key key2 Tru

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
>>> import memcache
>>> mc = memcache.Client(['127.0.0.1:11211'], debug=0)
>>> mc.set("key", "key2")
True
>>> v = mc.get("key")
>>> mc.set("key3",3)
True
>>> mc.delete("key3")
1
>>> mc.set("key","1")
True
>>> mc.incr("key")
2
>>> mc.decr("key")
1