天翼云分布式缓存服务Memcache连接方式(Python)
文档简介:
需要安装bmemcached Package,pip install python-binary-memcached
Python代码示例
import bmemcached
client = bmemcached.Client(('127.0.0.1:11211', ))
client.set('foo', '100')
print(client.get('foo'))
Python
需要安装bmemcached Package,pip install python-binary-memcached
Python代码示例
import bmemcached
client = bmemcached.Client(('127.0.0.1:11211', ))
client.set('foo', '100')
print(client.get('foo'))
Python链接配置了sasl验证的memcached示例
import bmemcached
# set sasl auth info username and password
client = bmemcached.Client(('127.0.0.1:11211'), 'username', 'password')
client.set('foo', '100')
print(client.get('foo'))