会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Erick - LONG
Be Patient! Be Positive! Be Persistence!
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
6
7
8
9
10
11
12
13
14
···
38
下一页
2018年4月22日
flask-login源码梳理
摘要:
阅读全文
posted @ 2018-04-22 20:39 Erick-LONG
阅读(250)
评论(0)
推荐(0)
2018年4月20日
pyttsx3 winsound win32api.MessageBox使用案例
摘要: import requests,time from lxml import etree import win32api,win32con import winsound import pyttsx3 cookies = str(input('请输入cookies:')) def ring(): engine = pyttsx3.init() engine.say('傻逼,有户...
阅读全文
posted @ 2018-04-20 14:23 Erick-LONG
阅读(407)
评论(0)
推荐(0)
2018年4月19日
迭代器。迭代协议
摘要: #什么是迭代协议 #迭代器是什么? 迭代器是访问集合内元素的一种方式, 一般用来遍历数据 #迭代器和以下标的访问方式不一样, 迭代器是不能返回的, 迭代器提供了一种惰性方式数据的方式 #[] list , __iter__ from collections.abc import Iterable, Iterator a = [1,2] iter_rator = iter(a) print (i...
阅读全文
posted @ 2018-04-19 17:13 Erick-LONG
阅读(153)
评论(0)
推荐(0)
元类编程-- 实现orm,以django Model为例
摘要: # 需求 import numbers class Field: pass class IntField(Field): # 数据描述符 def __init__(self, db_column, min_value=None, max_value=None): self._value = None self.min_value = ...
阅读全文
posted @ 2018-04-19 16:56 Erick-LONG
阅读(295)
评论(0)
推荐(0)
元类编程-- metaclass
摘要: #类也是对象,type创建类的类 def create_class(name): if name == "user": class User: def __str__(self): return "user" return User elif name == "company": ...
阅读全文
posted @ 2018-04-19 15:55 Erick-LONG
阅读(132)
评论(0)
推荐(0)
元类编程-- __new__和__init__的区别
摘要: class User: def __new__(cls, *args, **kwargs): print (" in new ") return super().__new__(cls) def __init__(self, name): print (" in init") pass a = int() #new ...
阅读全文
posted @ 2018-04-19 15:05 Erick-LONG
阅读(184)
评论(0)
推荐(0)
Flask 应用上下文和请求上线文原理图
摘要:
阅读全文
posted @ 2018-04-19 08:09 Erick-LONG
阅读(174)
评论(0)
推荐(0)
2018年4月18日
元类编程--__get__ __set__属性描述符
摘要: from datetime import date, datetime import numbers class IntField: #数据描述符,实现以下任意一个,都会变为属性描述符 def __get__(self, instance, owner): return self.value def __set__(self, instance, val...
阅读全文
posted @ 2018-04-18 18:51 Erick-LONG
阅读(210)
评论(0)
推荐(0)
元类编程--__getattr__, __getattribute__
摘要: #__getattr__, __getattribute__ #__getattr__ 就是在查找不到属性的时候调用 from datetime import date class User: def __init__(self,info={}): self.info = info def __getattr__(self, item): ret...
阅读全文
posted @ 2018-04-18 18:09 Erick-LONG
阅读(176)
评论(0)
推荐(0)
元类编程--property动态属性
摘要: from datetime import date, datetime class User: def __init__(self, name, birthday): self.name = name self.birthday = birthday self._age = 0 # def get_age(self): #...
阅读全文
posted @ 2018-04-18 17:18 Erick-LONG
阅读(126)
评论(0)
推荐(0)
上一页
1
···
6
7
8
9
10
11
12
13
14
···
38
下一页
公告