摘要: import redissrc_redis=redis.Redis(host='127.0.0.1',port=6379,password='123456',db=2)target_redis=redis.Redis(host='127.0.0.1',port=6379,password='1234 阅读全文
posted @ 2018-08-08 22:26 罗南 阅读(866) 评论(0) 推荐(0)
摘要: Windows下安装Redis服务 说明:本文拷贝自https://jingyan.baidu.com/article/0f5fb099045b056d8334ea97.html Redis是有名的NoSql数据库,一般Linux都会默认支持。但在Windows环境中,可能需要手动安装设置才能有效使 阅读全文
posted @ 2018-08-04 20:01 罗南 阅读(80) 评论(0) 推荐(0)
摘要: pip install redis pip install slask 数据库分两类: 1 关系型数据库 表 2 非关系型数据库 nosql key-value结构 memcache 内存 redis 内存 mongodb 磁盘 阅读全文
posted @ 2018-08-04 20:01 罗南 阅读(112) 评论(0) 推荐(0)
摘要: import pymysql#pyoracle# 1 连接上mysql ip 端口号 密码 账号 数据库# 2 建立游标# 3 执行sql# 4 获取结果conn = pymysql.connect(host='127.0.0.1',user='root',passwd='123456',port=3306,db='txz',charset='utf8')cur = conn.cursor(cur... 阅读全文
posted @ 2018-08-01 21:27 罗南 阅读(79) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2018-07-31 21:58 罗南 阅读(146) 评论(0) 推荐(0)
摘要: import datetimeprint(datetime.datetime.today())#获取当前时间,到秒 2018-07-31 21:44:54.316039print(datetime.datetime.now())#获取当前时间,到秒,同上 2018-07-31 21:44:54.31 阅读全文
posted @ 2018-07-31 21:54 罗南 阅读(120) 评论(0) 推荐(0)
摘要: import os,time#格式化时间转时间戳def strToTimestamp(time_str,format='%Y%m%d%H%M%S'): t = time.strptime(time_str,format)#格式化时间转化为时间元组 res = time.mktime(t)#时间元组转 阅读全文
posted @ 2018-07-31 21:29 罗南 阅读(151) 评论(0) 推荐(0)