摘要: my_list = [1,2,1,54,5,64,4681,4,676] my_list_two = list(set(my_list)) my_list_two.sort(key = my_list) print(my_list_two) 阅读全文
posted @ 2018-10-11 17:34 是鱼的记忆 阅读(1843) 评论(0) 推荐(0) 编辑
摘要: a = list(range(50)) b = list(range(50)) c = [] for x in a: c.insert(x, [a[x], b[x]]) print(c) 阅读全文
posted @ 2018-10-11 17:28 是鱼的记忆 阅读(292) 评论(0) 推荐(0) 编辑
摘要: from queue import Queue from threading import Thread import time q = Queue() def add_to_queue(): for i in range(10): print('添加') q.put(i) time.sleep(0.01) def get_from_q... 阅读全文
posted @ 2018-07-25 16:16 是鱼的记忆 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 就是这么简单 阅读全文
posted @ 2018-07-25 16:00 是鱼的记忆 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 函数:string.join() Python中有join()和os.path.join()两个函数,具体作用如下: join(): 连接字符串数组。将字符串、元组、列表中的元素以指定的字符(分隔符)连接生成一个新的字符串 os.path.join(): 将多个路径组合后返回 一、函数说明1、joi 阅读全文
posted @ 2018-07-24 23:29 是鱼的记忆 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 一直在想requests的content和text属性的区别,从print 结果来看是没有任何区别 结论是:text 返回的是unicode 型的数据,一般是在网页的header中定义的编码形式。 content返回的是bytes,二级制型的数据。 阅读全文
posted @ 2018-07-18 21:41 是鱼的记忆 阅读(8566) 评论(0) 推荐(0) 编辑