上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 38 下一页
摘要: 阅读全文
posted @ 2018-04-22 20:39 Erick-LONG 阅读(244) 评论(0) 推荐(0) 编辑
摘要: 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 阅读(399) 评论(0) 推荐(0) 编辑
摘要: #什么是迭代协议 #迭代器是什么? 迭代器是访问集合内元素的一种方式, 一般用来遍历数据 #迭代器和以下标的访问方式不一样, 迭代器是不能返回的, 迭代器提供了一种惰性方式数据的方式 #[] 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 阅读(149) 评论(0) 推荐(0) 编辑
摘要: # 需求 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 阅读(285) 评论(0) 推荐(0) 编辑
摘要: #类也是对象,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 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 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 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2018-04-19 08:09 Erick-LONG 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 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 阅读(203) 评论(0) 推荐(0) 编辑
摘要: #__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 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 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 阅读(122) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 38 下一页