1,打开memcached服务
memcached -m 10 -p 12000
2,使用python-memcached模块,进行简单的链接和存取数据
import memcache
mc = memcache.Client(['127.0.0.1:12000'], debug=0)
mc.set("foo", "bar")
mc.get("foo")
mc.disconnect_all()3,其它方法请参考:
help(mc)
【相关推荐】
1. Python免费视频教程
2. Python在数据科学中的应用
3. 基础入门教程