2019年3月5日

Python用@property使类方法像属性一样访问

摘要: class Screen(object): @property #读取with的值getter方法 def width(self): return self._width @width.setter #设置with的值setter方法 def width(self,value): self._width = value ... 阅读全文

posted @ 2019-03-05 10:26 er先森 阅读(441) 评论(0) 推荐(0) 编辑

笔记(assert 断言)

摘要: 并发:在同一个时间段交替执行多个任务并行:在同一个时间点同时执行多个任务串行:同时执行的多个任务按顺序执行(换句话说就是一个任务执行完后才能执行下一个任务) #mysql limit用法: select * from table limit m,n;m表示第m+1条数据起(因为索引是从零开始的)n表 阅读全文

posted @ 2019-03-05 10:19 er先森 阅读(430) 评论(0) 推荐(0) 编辑

Python使用__slots__限制实例属性

摘要: #定义一个类Student class Student(object): __slots__ = ('name','age') #用元组(tuple)的形式绑定属性名称 s = Student() s.name = 'xh' print s.name #xh #s.score = 88 #因为 __slots__中没有score属性,所以报错 #print s.score #A... 阅读全文

posted @ 2019-03-05 09:43 er先森 阅读(223) 评论(0) 推荐(0) 编辑

分别给Python类和实例增加属性和方法

摘要: #定义一个类Student class Student(object): pass #给类增加一个属性name Student.name = 'xm' print Student.name # xm #给类增加一个方法set_age def set_age(self,age): self.age = age Student.set_age = set_age s = Stu... 阅读全文

posted @ 2019-03-05 09:27 er先森 阅读(3667) 评论(0) 推荐(0) 编辑

2018年5月24日

用html页面模板使用django完成个人博客

摘要: 本文设计个人博客的一些功能包括:用户注册、用户登录、与mysql连接、图片上传、使用ajax实现文章点赞等功能 阅读全文

posted @ 2018-05-24 16:44 er先森 阅读(9351) 评论(1) 推荐(2) 编辑

django入门

摘要: django入门 阅读全文

posted @ 2018-05-24 11:53 er先森 阅读(302) 评论(0) 推荐(0) 编辑

2018年5月23日

数据库之redis

摘要: 本文说明了redis的基本用法,python与redis交互以及与mysql交互使用 阅读全文

posted @ 2018-05-23 21:30 er先森 阅读(347) 评论(0) 推荐(0) 编辑

数据库之mongodb

摘要: 本文主要讲解了一些mongodb的一些基本用法 阅读全文

posted @ 2018-05-23 21:10 er先森 阅读(260) 评论(0) 推荐(0) 编辑

2018年5月17日

数据库之mysql

摘要: mysql的各种用法 阅读全文

posted @ 2018-05-17 17:18 er先森 阅读(240) 评论(0) 推荐(0) 编辑

linux常用命令2

摘要: 这里介绍的是linux比较高级的东西,如:用户管理、用户组管理、文件管理等。 阅读全文

posted @ 2018-05-17 15:12 er先森 阅读(604) 评论(0) 推荐(0) 编辑

导航