欢迎使用CSDN-markdown编辑器

来源:互联网 发布:ie11 找不到js 编辑:程序博客网 时间:2024/06/11 18:44

Python Memcache Tips

  • 组件包:python-memcached-1.43
  • 使用例子

    import memcache
    mc = memcache.Client([‘127.0.0.1:11211’], debug=0)

    mc.set(“some_key”, “Some value”)
    value = mc.get(“some_key”)

    mc.set(“another_key”, 3)
    mc.delete(“another_key”)

    mc.set(“key”, “1”) # note that the key used for incr/decr must be a string.
    mc.incr(“key”)
    mc.decr(“key”)

0 0