Detailed explanation of python linking and operating memcache methods

高洛峰
Release: 2017-03-06 11:30:39
Original
1594 people have browsed it

1, open the memcached service

memcached -m 10 -p 12000
Copy after login

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()
Copy after login

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

help(mc)
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template