Python3 基础教程 - 廖雪峰
Python 程序的运行时间需要 0.1 秒,慢了 100 倍,但由于 网络更慢,需要等待 1 秒,你想,用户能感觉到 1.001 秒和 1.1 秒的区 别吗?这就好比 F1 赛车和普通的出租车在北京三环路上行驶的道理一 样,虽然 F1 赛车理论时速高达 400 公里,但由于三环路堵车的时速只 有 20 公里,因此,作为乘客,你感觉的时速永远是 20 公里。 Python3 基础教程【完整版】 种参数都可以组合使用,除了可变参数 无法和命名关键字参数混合。但是请注意,参数定义的顺序必须是:必 选参数、默认参数、可变参数/命名关键字参数和关键字参数。 比如定义一个函数,包含上述若干种参数: def f1(a, b, c=0, *args, **kw): print('a =', a, 'b =', b, 'c =', c, 'args =', args, 'kw =', kw) def 参数传进去。 >>> f1(1, 2) a = 1 b = 2 c = 0 args = () kw = {} >>> f1(1, 2, c=3) a = 1 b = 2 c = 3 args = () kw = {} >>> f1(1, 2, 3, 'a', 'b') a = 1 b = 2 c = 3 args = ('a', 'b') kw = {} >>> f1(1, 2, 3, 'a'0 码力 | 531 页 | 5.15 MB | 1 年前3peewee Documentation Release 3.0.0
print('Result: %s' % result.title) Parameters: classmethod search(term[, weights=None[, with_score=False[, score_alias='score'[, explicit_ordering=False]]]]) term (str) – Search term to use. weights – A list of name and mapped to a value. with_score – Whether the score should be returned as part of the SELECT statement. score_alias (str) – Alias to use for the calculated rank score. This is the attribute you will will use to access the score if with_score=True. explicit_ordering (bool) – Order using full SQL function to calculate rank, as opposed to simply referencing the score alias in the ORDER BY clause. Shorthand0 码力 | 319 页 | 361.50 KB | 1 年前3peewee Documentation Release 3.5.0
print('Result: %s' % result.title) classmethod search(term[, weights=None[, with_score=False[, score_alias='score'[, explicit_ordering=False]]]]) Parameters: term (str) – Search term to use. weights name and mapped to a value. with_score – Whether the score should be returned as part of the SELECT statement. score_alias (str) – Alias to use for the calculated rank score. This is the attribute you will will use to access the score if with_score=True. explicit_ordering (bool) – Order using full SQL function to calculate rank, as opposed to simply referencing the score alias in the ORDER BY clause. Shorthand0 码力 | 347 页 | 380.80 KB | 1 年前3peewee Documentation Release 3.4.0
print('Result: %s' % result.title) classmethod search(term[, weights=None[, with_score=False[, score_alias='score'[, explicit_ordering=False]]]]) Parameters: term (str) – Search term to use. weights name and mapped to a value. with_score – Whether the score should be returned as part of the SELECT statement. score_alias (str) – Alias to use for the calculated rank score. This is the attribute you will will use to access the score if with_score=True. explicit_ordering (bool) – Order using full SQL function to calculate rank, as opposed to simply referencing the score alias in the ORDER BY clause. Shorthand0 码力 | 349 页 | 382.34 KB | 1 年前3peewee Documentation Release 3.1.0
print('Result: %s' % result.title) Parameters: classmethod search(term[, weights=None[, with_score=False[, score_alias='score'[, explicit_ordering=False]]]]) term (str) – Search term to use. weights – A list of name and mapped to a value. with_score – Whether the score should be returned as part of the SELECT statement. score_alias (str) – Alias to use for the calculated rank score. This is the attribute you will will use to access the score if with_score=True. explicit_ordering (bool) – Order using full SQL function to calculate rank, as opposed to simply referencing the score alias in the ORDER BY clause. Shorthand0 码力 | 332 页 | 370.77 KB | 1 年前3peewee Documentation Release 3.5.0
query: print('Result: %s' % result.title) classmethod search(term[, weights=None[, with_score=False[, score_alias=’score’[, ex- plicit_ordering=False]]]]) Parameters • term (str) – Search term to use. 1 and mapped to a value. • with_score – Whether the score should be returned as part of the SELECT statement. • score_alias (str) – Alias to use for the calculated rank score. This is the attribute you will will use to access the score if with_score=True. • explicit_ordering (bool) – Order using full SQL function to calculate rank, as opposed to simply referencing the score alias in the ORDER BY clause.0 码力 | 282 页 | 1.02 MB | 1 年前3peewee Documentation Release 3.3.0
query: print('Result: %s' % result.title) classmethod search(term[, weights=None[, with_score=False[, score_alias=’score’[, ex- plicit_ordering=False]]]]) Parameters • term (str) – Search term to use. • and mapped to a value. • with_score – Whether the score should be returned as part of the SELECT statement. • score_alias (str) – Alias to use for the calculated rank score. This is the attribute you will will use to access the score if with_score=True. • explicit_ordering (bool) – Order using full SQL function to calculate rank, as opposed to simply referencing the score alias in the ORDER BY clause.0 码力 | 280 页 | 1.02 MB | 1 年前3peewee Documentation Release 3.4.0
query: print('Result: %s' % result.title) classmethod search(term[, weights=None[, with_score=False[, score_alias=’score’[, ex- plicit_ordering=False]]]]) Parameters • term (str) – Search term to use. • and mapped to a value. • with_score – Whether the score should be returned as part of the SELECT statement. • score_alias (str) – Alias to use for the calculated rank score. This is the attribute you will will use to access the score if with_score=True. • explicit_ordering (bool) – Order using full SQL function to calculate rank, as opposed to simply referencing the score alias in the ORDER BY clause.0 码力 | 284 页 | 1.03 MB | 1 年前3peewee Documentation Release 2.10.2
finalize(self): return self.product # To use this aggregate: product = (Score .select(fn.product(Score.value)) .scalar()) unregister_aggregate(name): Unregister the given query: print 'match: ', doc.title classmethod search(term[, weights=None[, with_score=False[, score_alias='score']]]) Shorthand way of searching for a term and sorting results by the quality of the name and mapped to a value. with_score – Whether the score should be returned as part of the SELECT statement. score_alias (str) – Alias to use for the calculated rank score. This is the attribute you will0 码力 | 275 页 | 276.96 KB | 1 年前3peewee Documentation Release 2.10.2
value def finalize(self): return self.product # To use this aggregate: product = (Score .select(fn.product(Score.value)) .scalar()) unregister_aggregate(name): Unregister the given aggregate function in query: print 'match: ', doc.title classmethod search(term[, weights=None[, with_score=False[, score_alias=’score’]]]) Shorthand way of searching for a term and sorting results by the quality of the mapped to a value. • with_score – Whether the score should be returned as part of the SELECT statement. 88 Chapter 1. Contents: peewee Documentation, Release 2.10.2 • score_alias (str) – Alias to use0 码力 | 221 页 | 844.06 KB | 1 年前3
共 191 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20