 Scrapy 0.9 Documentationby Scrapy, so it must be unique. However, nothing prevents you from instantiating more than one instance of the same spider. This is the most important spider attribute and it’s required. Is recommended __init__(self): self.duplicates = {} dispatcher.connect(self.spider_opened, signals.spider_opened) dispatcher.connect(self.spider_closed, signals.spider_closed) def spider_opened(self performed. smtppass (str) – the SMTP pass for authetnication. smtpport (int) – the SMTP port to connect to scrapy.mail.send(to, subject, body, cc=None, attachs=()) Send email to the given recipients0 码力 | 204 页 | 447.68 KB | 1 年前3 Scrapy 0.9 Documentationby Scrapy, so it must be unique. However, nothing prevents you from instantiating more than one instance of the same spider. This is the most important spider attribute and it’s required. Is recommended __init__(self): self.duplicates = {} dispatcher.connect(self.spider_opened, signals.spider_opened) dispatcher.connect(self.spider_closed, signals.spider_closed) def spider_opened(self performed. smtppass (str) – the SMTP pass for authetnication. smtpport (int) – the SMTP port to connect to scrapy.mail.send(to, subject, body, cc=None, attachs=()) Send email to the given recipients0 码力 | 204 页 | 447.68 KB | 1 年前3
 Python3 基础教程 - 廖雪峰和实例(Instance)的概念是很自然的。Class 是一种抽象概念,比如我 们定义的 Class——Student,是指学生这个概念,而实例(Instance)则 是一个个具体的 Student,比如,Bart Simpson 和 Lisa Simpson 是两个具 体的 Student。 所以,面向对象的设计思想是抽象出 Class,根据 Class 创建 Instance。 Class 既包含数据,又包 含操作数据的方法。 小结 数据封装、继承和多态是面向对象的三大特点,我们后面会详细讲解。 类和实例 面向对象最重要的概念就是类(Class)和实例(Instance),必须牢记 类是抽象的模板,比如 Student 类,而实例是根据类创建出来的一个个 具体的“对象”,每个对象都拥有相同的方法,但各自的数据可能不同。 仍以 Student 类为例,在 __call__ Python3 基础教程【完整版】 http://www.yeayee.com/ 205/531 一个对象实例可以有自己的属性和方法,当我们调用实例方法时,我们 用 instance.method()来调用。能不能直接在实例本身上调用呢?在 Python 中,答案是肯定的。 任何类,只需要定义一个__call__()方法,就可以直接对实例进行调用。 请看示例:0 码力 | 531 页 | 5.15 MB | 1 年前3 Python3 基础教程 - 廖雪峰和实例(Instance)的概念是很自然的。Class 是一种抽象概念,比如我 们定义的 Class——Student,是指学生这个概念,而实例(Instance)则 是一个个具体的 Student,比如,Bart Simpson 和 Lisa Simpson 是两个具 体的 Student。 所以,面向对象的设计思想是抽象出 Class,根据 Class 创建 Instance。 Class 既包含数据,又包 含操作数据的方法。 小结 数据封装、继承和多态是面向对象的三大特点,我们后面会详细讲解。 类和实例 面向对象最重要的概念就是类(Class)和实例(Instance),必须牢记 类是抽象的模板,比如 Student 类,而实例是根据类创建出来的一个个 具体的“对象”,每个对象都拥有相同的方法,但各自的数据可能不同。 仍以 Student 类为例,在 __call__ Python3 基础教程【完整版】 http://www.yeayee.com/ 205/531 一个对象实例可以有自己的属性和方法,当我们调用实例方法时,我们 用 instance.method()来调用。能不能直接在实例本身上调用呢?在 Python 中,答案是肯定的。 任何类,只需要定义一个__call__()方法,就可以直接对实例进行调用。 请看示例:0 码力 | 531 页 | 5.15 MB | 1 年前3
 2 张孝峰 Python与云 AWS的Python原生应用浅析 2008/12 v2.7 2010/7 v3.7 2018/6 贝索斯开始思考 微服务 2000 Amazon S3 2006/3 Amazon SQS 2006/7 Amazon EC2 2006/8 开始研发 2004 AWS Lambda 2014/11 2019/10 22个区域 165项服务 Python被称为“瑞士军刀” • Web开发 • AI / 机器学习0 码力 | 42 页 | 8.12 MB | 1 年前3 2 张孝峰 Python与云 AWS的Python原生应用浅析 2008/12 v2.7 2010/7 v3.7 2018/6 贝索斯开始思考 微服务 2000 Amazon S3 2006/3 Amazon SQS 2006/7 Amazon EC2 2006/8 开始研发 2004 AWS Lambda 2014/11 2019/10 22个区域 165项服务 Python被称为“瑞士军刀” • Web开发 • AI / 机器学习0 码力 | 42 页 | 8.12 MB | 1 年前3
 3 在AWS部署与发布你面向全球的Python Serverless应用 谢洪恩functions Endpoints in your VPC Regional API Endpoints AWS Lambda functions Endpoints on Amazon EC2 Your VPC AWS Manage APIs with API Gateway Queues Simple Fully-managed Any volume Pub/sub Simple0 码力 | 53 页 | 24.15 MB | 1 年前3 3 在AWS部署与发布你面向全球的Python Serverless应用 谢洪恩functions Endpoints in your VPC Regional API Endpoints AWS Lambda functions Endpoints on Amazon EC2 Your VPC AWS Manage APIs with API Gateway Queues Simple Fully-managed Any volume Pub/sub Simple0 码力 | 53 页 | 24.15 MB | 1 年前3
 peewee Documentation Release 2.10.2to database concepts: Thing Corresponds to… Model class Database table Field instance Column on a table Model instance Row in a database table When starting a project with peewee, it’s typically best database = db # this model uses the "people.db" database Now that we have our models, let’s connect to the database. Although it’s not necessary to open the connection explicitly, it is good practice connection when you are done – for instance, a web app might open a connection when it receives a request, and close the connection when it sends the response. >>> db.connect() We’ll begin by creating the0 码力 | 275 页 | 276.96 KB | 1 年前3 peewee Documentation Release 2.10.2to database concepts: Thing Corresponds to… Model class Database table Field instance Column on a table Model instance Row in a database table When starting a project with peewee, it’s typically best database = db # this model uses the "people.db" database Now that we have our models, let’s connect to the database. Although it’s not necessary to open the connection explicitly, it is good practice connection when you are done – for instance, a web app might open a connection when it receives a request, and close the connection when it sends the response. >>> db.connect() We’ll begin by creating the0 码力 | 275 页 | 276.96 KB | 1 年前3
 peewee Documentation
Release 2.10.2database concepts: Thing Corresponds to. . . Model class Database table Field instance Column on a table Model instance Row in a database table When starting a project with peewee, it’s typically best Meta: database = db # this model uses the "people.db" database Now that we have our models, let’s connect to the database. Although it’s not necessary to open the connection explicitly, it is good practice connection when you are done – for instance, a web app might open a connection when it receives a request, and close the connection when it sends the response. >>> db.connect() We’ll begin by creating the0 码力 | 221 页 | 844.06 KB | 1 年前3 peewee Documentation
Release 2.10.2database concepts: Thing Corresponds to. . . Model class Database table Field instance Column on a table Model instance Row in a database table When starting a project with peewee, it’s typically best Meta: database = db # this model uses the "people.db" database Now that we have our models, let’s connect to the database. Although it’s not necessary to open the connection explicitly, it is good practice connection when you are done – for instance, a web app might open a connection when it receives a request, and close the connection when it sends the response. >>> db.connect() We’ll begin by creating the0 码力 | 221 页 | 844.06 KB | 1 年前3
 peewee Documentation Release 1.0.0to explicitly connect to the database before using it, managing connections explicitly is a good practice. This way if the connection fails, the exception can be caught during the “connect” step, rather arbitrary time later when a query is executed. >>> database = SqliteDatabase('stats.db') >>> database.connect() To use this database with your models, specify it in an inner “Meta” class: class MyModel(Model): = peewee.CharField() ... ... class Meta: ... database = custom_db ... >>> custom_db.connect() >>> CustomModel.create_table() Best practice: define a base model class that points at the database0 码力 | 101 页 | 163.20 KB | 1 年前3 peewee Documentation Release 1.0.0to explicitly connect to the database before using it, managing connections explicitly is a good practice. This way if the connection fails, the exception can be caught during the “connect” step, rather arbitrary time later when a query is executed. >>> database = SqliteDatabase('stats.db') >>> database.connect() To use this database with your models, specify it in an inner “Meta” class: class MyModel(Model): = peewee.CharField() ... ... class Meta: ... database = custom_db ... >>> custom_db.connect() >>> CustomModel.create_table() Best practice: define a base model class that points at the database0 码力 | 101 页 | 163.20 KB | 1 年前3
 peewee Documentation
Release 1.0.0to explicitly connect to the database before using it, managing connections explicitly is a good practice. This way if the connection fails, the exception can be caught during the “connect” step, rather arbitrary time later when a query is executed. >>> database = SqliteDatabase(’stats.db’) >>> database.connect() To use this database with your models, specify it in an inner “Meta” class: class MyModel(Model): whatev = peewee.CharField() ... ... class Meta: ... database = custom_db ... >>> custom_db.connect() >>> CustomModel.create_table() Best practice: define a base model class that points at the database0 码力 | 71 页 | 405.29 KB | 1 年前3 peewee Documentation
Release 1.0.0to explicitly connect to the database before using it, managing connections explicitly is a good practice. This way if the connection fails, the exception can be caught during the “connect” step, rather arbitrary time later when a query is executed. >>> database = SqliteDatabase(’stats.db’) >>> database.connect() To use this database with your models, specify it in an inner “Meta” class: class MyModel(Model): whatev = peewee.CharField() ... ... class Meta: ... database = custom_db ... >>> custom_db.connect() >>> CustomModel.create_table() Best practice: define a base model class that points at the database0 码力 | 71 页 | 405.29 KB | 1 年前3
 peewee Documentation
Release 2.0.2to explicitly connect to the database before using it, managing connections explicitly is a good practice. This way if the connection fails, the exception can be caught during the “connect” step, rather arbitrary time later when a query is executed. >>> database = SqliteDatabase(’stats.db’) >>> database.connect() To use this database with your models, specify it in an inner “Meta” class: class MyModel(Model): CustomModel(Model): ... whatev = CharField() ... ... class Meta: ... database = custom_db ... >>> custom_db.connect() >>> CustomModel.create_table() Best practice: define a base model class that points at the database0 码力 | 65 页 | 315.33 KB | 1 年前3 peewee Documentation
Release 2.0.2to explicitly connect to the database before using it, managing connections explicitly is a good practice. This way if the connection fails, the exception can be caught during the “connect” step, rather arbitrary time later when a query is executed. >>> database = SqliteDatabase(’stats.db’) >>> database.connect() To use this database with your models, specify it in an inner “Meta” class: class MyModel(Model): CustomModel(Model): ... whatev = CharField() ... ... class Meta: ... database = custom_db ... >>> custom_db.connect() >>> CustomModel.create_table() Best practice: define a base model class that points at the database0 码力 | 65 页 | 315.33 KB | 1 年前3
 peewee Documentation Release 3.0.0to database concepts: Object Corresponds to… Model class Database table Field instance Column on a table Model instance Row in a database table When starting a project with peewee, it’s typically best database = db # this model uses the "people.db" database Now that we have our models, let’s connect to the database. Although it’s not necessary to open the connection explicitly, it is good practice connection when you are done – for instance, a web app might open a connection when it receives a request, and close the connection when it sends the response. db.connect() We’ll begin by creating the tables0 码力 | 319 页 | 361.50 KB | 1 年前3 peewee Documentation Release 3.0.0to database concepts: Object Corresponds to… Model class Database table Field instance Column on a table Model instance Row in a database table When starting a project with peewee, it’s typically best database = db # this model uses the "people.db" database Now that we have our models, let’s connect to the database. Although it’s not necessary to open the connection explicitly, it is good practice connection when you are done – for instance, a web app might open a connection when it receives a request, and close the connection when it sends the response. db.connect() We’ll begin by creating the tables0 码力 | 319 页 | 361.50 KB | 1 年前3
共 516 条
- 1
- 2
- 3
- 4
- 5
- 6
- 52














 
 