摘要: 1. 下载boost(以1.75版本为例) https://www.boost.org/users/history/version_1_75_0.html 2. 下载完成之后,解压压缩包 tar -xjf boost_1_75_0.tar.bz2 // 其中boost_1_75_0.tar.bz2为 阅读全文
posted @ 2022-01-06 19:41 ‘哦耶’ 阅读(3517) 评论(0) 推荐(0) 编辑
摘要: 1.关于智能指针 智能指针是存储“指向动态分类(在堆上)的对象的指针”。类似与普通指针,不同的是它们会在适当的时间自动回收空间。智能指针在面对出现异常情况下有着较好的下效果,可以确保动态分配的对象被析构。 2.scoped_ptr scoped_ptr存储一个指向动态分配对象的指针,在scoped_ 阅读全文
posted @ 2021-12-30 21:27 ‘哦耶’ 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 1.处理文件,用户指定要查找的文件和内容,将文件中包含要查找内容的每一行都输出到屏幕 # def find(str): # with open('test',mode='r',encoding='utf-8') as f: # for line in f: # if str in line: # y 阅读全文
posted @ 2019-07-07 10:18 ‘哦耶’ 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 1.编写装饰器,为多个函数加上认证的功能(用户的账号密码来源于文件),要求登录成功一次,后续的函数都无需再输入用户名和密码 # FALG = False # def login(user,passwprd): # with open('admin',mode='r',encoding='utf-8' 阅读全文
posted @ 2019-06-28 11:08 ‘哦耶’ 阅读(191) 评论(0) 推荐(0) 编辑
摘要: 恢复内容开始 1.timmer是装饰器函数 test是被装饰的函数 import time def test(): time.sleep(1) print(" ") def timmer(f): def inner(): start = time.time() f() end = time.time 阅读全文
posted @ 2019-06-26 15:43 ‘哦耶’ 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 1.timmer是装饰器函数 test是被装饰的函数 import time def test(): time.sleep(1) print(" ") def timmer(f): def inner(): start = time.time() f() end = time.time() prin 阅读全文
posted @ 2019-06-26 15:16 ‘哦耶’ 阅读(86) 评论(0) 推荐(0) 编辑
摘要: python函数练习题 # def f1(l): # return l[1::2] # print(f1([1,2,3,4,5,6])) # 2.写函数,判断用户传入的对象(字符串,列表,元组)长度是否大于5 # def f2(l): # if len(l)>5: # return True # e 阅读全文
posted @ 2019-06-25 22:07 ‘哦耶’ 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 1.浅copy 2.深copy 阅读全文
posted @ 2019-06-21 08:56 ‘哦耶’ 阅读(85) 评论(0) 推荐(0) 编辑
摘要: 1 字典dic = {'k1':"v1",'k2'="v2","k3":[11,22,33]} 2)元素分类 有如下值li=[11,22,33,44,55,66,77,88,99,90],将所有大于等于66的值保存至 字典的第一个key中,将小于66的值保存至第二个key值中 3)输出商品列表,用户 阅读全文
posted @ 2019-06-19 18:49 ‘哦耶’ 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 1.写代码,有如下列表,按照要求实现每一个功能 li = ['alex','wusir','eric','rain','alex'] # 1)计算列表长度并输出 #print(len(li)) # 2)列表追加元素‘seven’ #li.append('seven') # 3)在列表的第一个元素插入 阅读全文
posted @ 2019-06-17 19:54 ‘哦耶’ 阅读(129) 评论(0) 推荐(0) 编辑