# apt-get install memcached python-memcached
// 若沒有 python-memcached 這個套件
// $ wget ftp://ftp.tummy.com/pub/python-memcached/python-memcached-latest.tar.gz
# vi /etc/memcached.conf
# /etc/init.d/memcached restart
import memcache
mc = memcache.Client(['127.0.0.1:11211'], debug=0)
mc.set("foo", "bar", 60*5)
value = mc.get("foo")
print value
沒有留言:
張貼留言