上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 41 下一页
摘要: 这样从效果就可以看出当再次访问home页面的时候,每次都需要打印before以及after 阅读全文
posted @ 2017-12-18 15:44 howhy 阅读(3184) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2017-12-07 21:05 howhy 阅读(142) 评论(0) 推荐(0)
摘要: 方差等于平方的均值减去均值的平方” 方差公式: 平均数: (n表示这组数据个数,x1、x2、x3……xn表示这组数据具体数值) 方差公式: 标准差又叫均方差 是方差开平方根 import math math.sqrt(方差) 首先均值,样本方差,样本协方差公式分别为 其中样本方差公式中为什么除的n- 阅读全文
posted @ 2017-12-06 15:11 howhy 阅读(1379) 评论(0) 推荐(0)
摘要: class doges(object): """类的描述信息""" def __init__(self,name,food): self.name=name self.food=food self.data={}#定义一个类的字典 def __call__(self, *args, **kwargs):#对象后面加括号解执行... 阅读全文
posted @ 2017-11-15 16:07 howhy 阅读(223) 评论(0) 推荐(0)
摘要: class MyType(type): def __init__(self,*args,**kwargs): print("Mytype __init__",*args,**kwargs) def __call__(self, *args, **kwargs): print("Mytype __ca 阅读全文
posted @ 2017-11-15 14:04 howhy 阅读(403) 评论(0) 推荐(0)
摘要: 经典类只@property 没有setter 和deleter 1.23 23.4 1.23 23.4 1.23 23.4 23.4 del attr del attr del attr del attr 阅读全文
posted @ 2017-11-14 11:13 howhy 阅读(214) 评论(0) 推荐(0)
摘要: start start start this is a custom exception this is a custom exception this is a custom exception end end end myexception=MyException('231') print(ha 阅读全文
posted @ 2017-11-13 21:29 howhy 阅读(144) 评论(0) 推荐(0)
摘要: Django提供一种信号机制。其实就是观察者模式,又叫发布-订阅(Publish/Subscribe) 。当发生一些动作的时候,发出信号,然后监听了这个信号的函数就会执行。 Django内置了一些信号,比如: django.db.models.signals.pre_save 在某个Model保存之 阅读全文
posted @ 2017-11-11 13:58 howhy 阅读(948) 评论(0) 推荐(0)
摘要: class SingleObj(): __singleobj=None @classmethod def get_singleinstance(cls): if not cls.__singleobj: cls.__singleobj=SingleObj() return cls.__singleobj obj1=S... 阅读全文
posted @ 2017-11-05 16:18 howhy 阅读(156) 评论(0) 推荐(0)
摘要: PS D:\python\py_test> python3 .\t1.py 手动触发exceptionerror: 出错了 print(123) assert 1==1##若成立则执行后面的代码 反之直接报错 print(456) 阅读全文
posted @ 2017-11-05 15:23 howhy 阅读(470) 评论(0) 推荐(0)
上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 41 下一页