摘要: celery异步消息处理框架 Fastdfs 分布式文件存储系统, 主要用来存储单个较小的文件 如何将cookie中的数据合并到redis中: cookie中只能保存字符串数据, 所以要将购物车数据使用pickie模块dumps序列化转换(装换成二进制字节类型), 然后使用base64编码为字符串, 阅读全文
posted @ 2018-09-27 18:42 exchange<> 阅读(188) 评论(0) 推荐(0) 编辑
摘要: print语句被print函数所替代 Input(int型) raw_input(str型) xrange被range取代 Os 用来从操作系统, 文件处理 Sys 对解释器的操作 Random 随机数 Time 时间模块 Re 正则 第三方模块: 进程, 线程, celery, django, f 阅读全文
posted @ 2018-09-27 18:41 exchange<> 阅读(229) 评论(0) 推荐(0) 编辑
摘要: class A(object): tiao = "类属性" def sing(self,name): self.name = name return self.name @classmethod def hang(cls,*args): return args @staticmethod def r 阅读全文
posted @ 2018-09-27 18:39 exchange<> 阅读(101) 评论(0) 推荐(0) 编辑
摘要: 方法一from collections import Counterimport rewith open('../one_one.py',encoding="utf-8",)as f: f1 = f.read() rest = re.findall(r'[a-zA-Z].+',f1) res = C 阅读全文
posted @ 2018-09-27 18:39 exchange<> 阅读(523) 评论(0) 推荐(0) 编辑
摘要: import osdef func(filepath): res = os.listdir(filepath) list1 = [] for k in res: ret = os.path.join(filepath,k) if os.path.isfile(ret): list1.append(r 阅读全文
posted @ 2018-09-27 18:38 exchange<> 阅读(158) 评论(0) 推荐(0) 编辑
摘要: dicts = {'zhang':22,'wang':44,'li':31,'zhao':27}s = sorted(dicts.items(),key=lambda x:x[0])print(s)ss = sorted(dicts.items(), key=lambda x:x[1])print( 阅读全文
posted @ 2018-09-27 18:38 exchange<> 阅读(83) 评论(0) 推荐(0) 编辑
摘要: 1. 冒泡排序: 时间复杂度O(n**2) def MaoPao(alist): for i in range(len(alist)-1): for j in range(len(alist)-i-1): if alist[j] > alist[j+1]: alist[j], alist[j+1] 阅读全文
posted @ 2018-09-27 18:37 exchange<> 阅读(96) 评论(0) 推荐(0) 编辑
摘要: s = 'i like you, but just i like you'def func(s): ret = s.split(' ') ss = ret[::-1] for i in ss: print(i,end=' ')x = func(s)print(x) 阅读全文
posted @ 2018-09-27 18:37 exchange<> 阅读(431) 评论(0) 推荐(0) 编辑
摘要: mystr = 'hello world itcast and itcastcpp's = mystr.find('hello')print(s)ind = mystr.index('world')print(ind)cou = mystr.count('c')print(cou)rep = mys 阅读全文
posted @ 2018-09-27 18:29 exchange<> 阅读(74) 评论(0) 推荐(0) 编辑