摘要: 测试#Author:walterclass Dog: def __init__(self,name): self.name = name def bulk(self): print("%s:wang wang wang"%self.name)d1 = Dog("lzq")d2 = Dog("walt 阅读全文
posted @ 2018-08-28 00:44 walter清 阅读(107) 评论(0) 推荐(0) 编辑
摘要: #######调用函数#########1.定义:模块:用来从逻辑上组织python代码(变量,函数,累,路基:实现一个功能),本质就是.py结尾的python文件(文件名:test.py,对应的模块名:test)包:用来从逻辑上组织模块的,本质就是一个目录(必须带有一个__init__.py文件) 阅读全文
posted @ 2018-08-25 22:53 walter清 阅读(144) 评论(0) 推荐(0) 编辑
摘要: ####列表序列化#Author:walter#json和pickle 的用法相同,单如果涉及到函数序列化要用pickle #序列化一次,反序列化一次。pickle打开需要二进制bimport json, pickle #操作# def sayhi(name):# print("hello,",na 阅读全文
posted @ 2018-08-23 12:36 walter清 阅读(111) 评论(0) 推荐(0) 编辑
摘要: ###装饰器 #Author:walter##装饰器:#定义:本质是函数,(装饰其他函数)就是为其他函数添加附加功能#原则:1,不能修改被装饰函数的源代码 #2,不能修改被装饰函数的调用方式#实现装饰器知识储备:# 1.函数即“变量”# 2.高阶函数:a,把一个函数名当做实参,传给另外一函数 # ( 阅读全文
posted @ 2018-08-22 12:30 walter清 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 字符转录翻译 阅读全文
posted @ 2018-08-19 22:38 walter清 阅读(141) 评论(0) 推荐(0) 编辑
摘要: #Author:walterdata = { '北京':{ "昌平":{ "沙河":["oldboy","test"], "天通苑":["链家地产","我爱我家"] }, "朝阳":{ "望京":["奔驰","陌陌"], "国贸":{"CICC","HP"}, "东直门":{&quo 阅读全文
posted @ 2018-08-19 22:28 walter清 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 列表 #Author:walterimport copynames = ["LiZhiQing","walter",["mapple","maple"],"Aqing"]names.append("LZQ")#最后插入名字names.insert(1,"WXC")#在某个位置插入names[2] = 阅读全文
posted @ 2018-08-19 22:15 walter清 阅读(113) 评论(0) 推荐(0) 编辑
摘要: #Author:walter_username = 'walter'_password = '12345678'i=1while True: username = input("username: ") password = input("password: ") if username ==_us 阅读全文
posted @ 2018-08-19 22:12 walter清 阅读(62) 评论(0) 推荐(0) 编辑
摘要: #Author:walter猜测数字age_of_oldboy = 56count = 0while count <3:#while True:# if count == 3:# break guess_age = int(input("guess age:")) if guess_age== ag 阅读全文
posted @ 2018-08-19 22:09 walter清 阅读(58) 评论(0) 推荐(0) 编辑