分类
摘要:
安装
pip install django==1.11.7
pip install celery
项目目录
AXF
├── alipay_config
│ ├── alipay_rsa_public_key.pem
│ └── app_rsa_private_key.pem
... 阅读原文
2018-12-25 11:45:03 阅读(8102) 评论(0)
摘要:
一、BOM对象
1,window对象
所有浏览器都支持window对象,从概念上讲:一个HTML文档对应一个window对象,从功能上讲:控制浏览器窗口的,从使用上讲:window对象不需要创建对象,直接使用即可
2,window对象方法
alert() 显示带有一段消息和一个... 阅读原文
2018-12-25 10:15:24 阅读(12531) 评论(0)
摘要:
Scrapy
Scrapy 是一个位了爬取网站数据,提取数据结构性数据而编写的应用框架,少量代码,就能快速爬取,使用了Twisted 异步网络框架,加快我们下载速度!
工作流程
制作 Scrapy 爬虫 一共需要4步:
新建项目 (scrapy startproject xxx):新建一个新的爬虫项... 阅读原文
2018-12-25 10:03:04 阅读(8462) 评论(0)
摘要:
class Init(object):
def __init__(self, v):
print("init")
self.val = v
class Add2(Init):
def __init__(self, val):
print("Add... 阅读原文
2018-12-25 08:22:02 阅读(12486) 评论(0)
摘要:
1. 了解python2和python3类的区别
python2在2.3之前使用的是经典类, 2.3之后, 使用的是新式类
2. 经典类的MRO 树形结构的深度优先遍历 -> 树形结构遍历
class A:
pass
class B(A):
pass
class C(A):
... 阅读原文
2018-12-25 07:25:31 阅读(7888) 评论(0)
摘要:
1.isinstance, type, issubclass 的含义
isinstance: 判断你给对象时候是xxx类型的.(向上判断)
type: 返回xxx对象的数据类型
issubclass: 判断xxx类是否xxx的子类
class Animal:
def eat(self):
... 阅读原文
2018-12-25 06:00:07 阅读(8541) 评论(0)
摘要:
集合(Set)及其函数
集合是一个无序的、无重复元素的序列。
1 list = {1, 3, 6, 5, 7, 9, 11, 3, 7} # 定义集合方式一
2 list1 = set([1, 3, 6, 5, 7, 9, 11, 3, 7]) # 定义集合方式二
3 list2 = set() # 定... 阅读原文
2018-12-25 06:00:06 阅读(8628) 评论(0)
摘要:
1.经典MRO : 树形结构的深度遍历优先 - > 树形结构遍历
class A:
pass
class B(A):
pass
class C(A):
pass
class D(B, C):
pass
class E:
pass
class F(D, E):
p... 阅读原文
2018-12-25 00:19:02 阅读(7085) 评论(0)
摘要:def task(): print('start') yield hello('dufeixiang') #阻塞当前函数运行而运行另外一个函数,另一个函数中可以再返回当程序最后阻塞的地方继续运行。def hello(name): print(name)task() task().__next__(... 阅读原文
2018-12-25 00:09:50 阅读(7090) 评论(0)
摘要:
分别给出了两个API,一个创造密码,一个验证密码正好满足需求。于是赶紧试试:
首先,引入模块:
1
>>> from django.contrib.auth.hashers import make_password, check_password
生成密码:
1
... 阅读原文
2018-12-24 22:47:02 阅读(7057) 评论(0)