摘要: userlist = [ {'name':'doudou','passwd':'123'}, {'name':'chouchou','passwd':'456'}, {'name':'liuhaiquan','passwd':'789'}, {'name':'liuxue','passwd':'20 阅读全文
posted @ 2018-04-08 18:43 阜阳小全 阅读(101) 评论(0) 推荐(0) 编辑
摘要: #每执行一次函数,都要验证一下用户名和密码。#先写出index(), home(name), shopcar(name)的函数#然后再写出装饰器,装饰器在执行之前需要判断用户和密码def jd(yonghu): def gou(*args,**kwargs): username = input('用 阅读全文
posted @ 2018-04-08 17:35 阜阳小全 阅读(94) 评论(0) 推荐(0) 编辑
摘要: f1 = 2f2 = 1f1,f2 = f2,f1print(f1) #1print(f2) #2 阅读全文
posted @ 2018-04-08 14:45 阜阳小全 阅读(94) 评论(0) 推荐(0) 编辑
摘要: import time#装饰器的架子如下def timmer(func): def wrapper(*args,**kwargs): start_time = time.time() res = func(*args,**kwargs) #这一步就是在运行test stop_time = time. 阅读全文
posted @ 2018-04-08 14:10 阜阳小全 阅读(122) 评论(0) 推荐(0) 编辑
摘要: import time#装饰器的架子如下def timmer(func): def wrapper(): start_time = time.time() res = func() #这一步就是在运行test stop_time = time.time() print('程序运行时间是%s' %(s 阅读全文
posted @ 2018-04-08 13:32 阜阳小全 阅读(93) 评论(0) 推荐(0) 编辑
摘要: import time#装饰器的架子如下def timmer(func): def wrapper(): # print(func) start_time = time.time() func() #这一步就是在运行test stop_time = time.time() print('程序运行时间 阅读全文
posted @ 2018-04-08 13:24 阜阳小全 阅读(79) 评论(0) 推荐(0) 编辑
摘要: import copy #需要先倒入模块husband = ['xiaohu',123,[15000,9000]]wife = husband.copy()wife[0] = 'xiaopang'wife[1] = 234# xiaosan = copy.copy()#浅拷贝xiaosan = co 阅读全文
posted @ 2018-04-08 09:02 阜阳小全 阅读(80) 评论(0) 推荐(0) 编辑
摘要: # s1 = [1,'alex','lda']# s2 = s1.copy()# s2[0] = 2# print('s1 ',s1)# print('s2 ',s2)# a = [[1,2],3,4]#浅copy只copy第一层#用途: 银行的关联账户,一个账户取钱,另一个账户的钱也会减少husb 阅读全文
posted @ 2018-04-08 08:48 阜阳小全 阅读(128) 评论(0) 推荐(0) 编辑