Home  >  Article  >  Backend Development  >  Detailed explanation of python linking and operating memcache methods

Detailed explanation of python linking and operating memcache methods

高洛峰
高洛峰Original
2017-03-06 11:30:391444browse

1, open the memcached service

memcached -m 10 -p 12000

2, use the python-memcached module, Perform simple links and access data

##

import memcache
 
mc = memcache.Client(['127.0.0.1:12000'], debug=0)

mc.set("foo", "bar")

mc.get("foo")

mc.disconnect_all()

##3. For other methods, please refer to:

help(mc)

The above python link and memcache operation method are all the content shared by the editor. I hope it can give you a reference, and I hope Please support PHP Chinese website.

For more python links and detailed explanations of how to operate memcache, please pay attention to the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn