yasmine_yang

导航

随笔分类 -  python点滴积累

阿布云代理的使用方法
摘要:import requestsHEADERS = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/ 阅读全文

posted @ 2019-01-15 18:21 yasmine_yang 阅读(2162) 评论(0) 推荐(0)

MongoDB连接
摘要:1. import pymongo client = pymongo.MongoClient(host='localhost',port=27017) 2. client=MongoClient('mongodb://localhost:27017/') 阅读全文

posted @ 2019-01-09 16:48 yasmine_yang 阅读(147) 评论(0) 推荐(0)

字符串拼接3种方法
摘要:1. % 阅读全文

posted @ 2019-01-08 16:47 yasmine_yang 阅读(402) 评论(0) 推荐(0)

redis操作
摘要:键操作 字符串操作:支持最基本的键值对形式存储 列表操作:列表内的元素可以重复,而且可以从两端存储 集合操作:集合中的元素都是不重复的 有序集合操作:有序集合比集合多了一个分数字段,利用它可以对集合中的数据进行排序 散列操作:利用name指定一个散列表的名称,表内存储了各个键值对 阅读全文

posted @ 2019-01-07 11:02 yasmine_yang 阅读(83) 评论(0) 推荐(0)

Redis连接方式
摘要:连接redis 本地安装了Redis并运行在6379端口,密码设置为 foobared. 1. from redis import StrictRedis redis = StrictRedis(host='localhost',port=6379,db=0,password='foobared') 阅读全文

posted @ 2019-01-07 10:57 yasmine_yang 阅读(8295) 评论(0) 推荐(0)

进度条
摘要:def view_bar(num, total): rate = float(num) / float(total) rate_num = int(rate * 100) r = '\r[%s%s]%d%%' % ("="*(rate_num), " "*(100-rate_num), rate_n 阅读全文

posted @ 2018-12-12 18:05 yasmine_yang 阅读(96) 评论(0) 推荐(0)

python unittest框架
摘要:四个部分: test fixture A test fixture represents(代表) the preparation needed to perform one or more tests, and any associate cleanup actions. This may invo 阅读全文

posted @ 2018-12-12 15:25 yasmine_yang 阅读(149) 评论(0) 推荐(0)

e充电加密破解
摘要:def encrypt(self,stationId ): keys = 'F29E0E39-98E4-F4CC318443' encrypt_obj = pyDes.triple_des(keys, pyDes.ECB, "\0\0\0\0\0\0\0\0", pad=None, padmode= 阅读全文

posted @ 2018-12-11 16:24 yasmine_yang 阅读(1024) 评论(1) 推荐(1)

获取范围内渔网数据
摘要:解析地图 阅读全文

posted @ 2018-12-11 15:11 yasmine_yang 阅读(582) 评论(0) 推荐(0)

字符串列表相互转换
摘要:1.字符串转列表 split() str1 = "hi hello world"print(str1.split(" "))输出:['hi', 'hello', 'world'] 2.列表转字符串 " ".join() l = ["hi","hello","world"] #str = " ".jo 阅读全文

posted @ 2018-12-11 14:55 yasmine_yang 阅读(208) 评论(0) 推荐(0)

定时任务BlockingScheduler
摘要:def task(): current_time = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') print(current_time) coordinate_list = Getlnglat().spyder_list_all() p 阅读全文

posted @ 2018-12-11 14:46 yasmine_yang