1 Star 4 Fork 3

小榔头XLT/python_cache

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
test_demo.py 651 Bytes
一键复制 编辑 原始数据 按行查看 历史
魏鹏程 提交于 2020-08-10 22:20 +08:00 . 新增'redis缓存'
# coding=utf-8
import json
import time
# import requests
import os
from cache import FileCache as ca, RunTime as run, RedisCache as redis
#
# options1 = {
# 'path': 'cache'
# }
# cache = ca.Cache(options1)
# print(run.RunTime())
# print(cache.getCacheKey('name'))
# print(cache.set('userInfo', '我是一段字符串', 3600))
# print(cache.get('userInfo'))
# print(cache.delete('userInfo1'))
# print(cache.has('userInfo'))
# print(cache.pull('userInfo'))
options = {
'host': "127.0.0.1"
}
redis = redis.RedisCache(options)
print(redis.set('test', 111,expire=2))
print(redis.get('test'))
print(redis.has('test'))
print(redis.delete('test'))
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/wei_pengcheng/python_cache.git
git@gitee.com:wei_pengcheng/python_cache.git
wei_pengcheng
python_cache
python_cache
master

搜索帮助