Tornado 6.5 DocumentationBlocking A function blocks when it waits for something to happen before returning. A function may block for many reasons: network I/O, disk I/O, mutexes, etc. In fact, every function blocks, at least a with Python control sequences and expressions embedded within the markup: <title>{{ title }}title>-
{% for item in items %}
- {{ escape(item) }} {% end %} RequestHandler): def get(self): items = ["Item 1", "Item 2", "Item 3"] self.render("template.html", title="My title", items=items) Tornado templates support control statements and expressions. Control statements
0 码力 | 272 页 | 1.12 MB | 3 月前3
Tornado 6.5 DocumentationBlocking A function blocks when it waits for something to happen before returning. A function may block for many reasons: network I/O, disk I/O, mutexes, etc. In fact, every function blocks, at least a control sequences and expressions embedded within the markup: <title>{{ title }}title>-
{% for item in items %}
- {{ escape(item) get(self): items = ["Item 1", "Item 2", "Item 3"] self.render("template.html", title="My title", items=items) Tornado templates support control statements and expressions. Control statements
0 码力 | 437 页 | 405.14 KB | 3 月前3
Rust 程序设计语言 简体中文版 1.85.0工具来抓取两个网页,拉取各自的 <title> 元素,并打印出第一个完成全部过程的那个页面的 标题。 定义 page_title 函数 让我们开始编写一个函数,它获取一个网页 URL 作为参数,请求该 URL 并返回标题元素的文 本(见示例 17-1)。 文件名:src/main.rs use trpl::Html; async fn page_title(url: &str) -> OptionHtml::parse(&response_text) .select_first("title") .map(|title_element| title_element.inner_html()) } 首先,我们定义一个名为 page_title 的函数,并使用了 async 关键字标记。接着我们使用 trpl::get 函数来获取传入的任意 URL,然后使用 HTML 作为更丰富数据结构来操作的数 据类型。特别是我们可以使用 select_first 方法来找出给定 CSS 选择器(selector)中第一 个匹配元素。通过传递字符串 "title",我们会得到文档中的第一个 <title> 元素,如果它存 在的话。由于可能没有任何匹配的元素,select_first 返回一个 Option 。最后 我们使用 Option::map 方法,它允许我们在 0 码力 | 562 页 | 3.23 MB | 22 天前3
julia 1.10.10Evaluation Scope of Default Values . . . . . . . . . . . . . . . . . . . . . . . . . . 83 8.16 Do-Block Syntax for Function Arguments . . . . . . . . . . . . . . . . . . . . . . . . 83 8.17 Function composition encounter! help?> begin search: begin disable_sigint reenable_sigint begin begin...end denotes a block of code. If you already know Julia a bit, you might want to peek ahead at Performance Tips and Workflow the rounding can be changed only within the execution of a particular block of code by using the same functions with a do block: julia> setrounding(BigFloat, RoundUp) do BigFloat(1) + parse(BigFloat0 码力 | 1692 页 | 6.34 MB | 3 月前3
Julia 1.10.9Evaluation Scope of Default Values . . . . . . . . . . . . . . . . . . . . . . . . . . 83 8.16 Do-Block Syntax for Function Arguments . . . . . . . . . . . . . . . . . . . . . . . . 83 8.17 Function composition encounter! help?> begin search: begin disable_sigint reenable_sigint begin begin...end denotes a block of code. If you already know Julia a bit, you might want to peek ahead at Performance Tips and Workflow the rounding can be changed only within the execution of a particular block of code by using the same functions with a do block: julia> setrounding(BigFloat, RoundUp) do BigFloat(1) + parse(BigFloat0 码力 | 1692 页 | 6.34 MB | 3 月前3
Julia 1.11.4Evaluation Scope of Default Values . . . . . . . . . . . . . . . . . . . . . . . . . . 88 9.16 Do-Block Syntax for Function Arguments . . . . . . . . . . . . . . . . . . . . . . . . 88 9.17 Function composition encounter! help?> begin search: begin disable_sigint reenable_sigint begin begin...end denotes a block of code. If you already know Julia a bit, you might want to peek ahead at Performance Tips and Workflow the rounding can be changed only within the execution of a particular block of code by using the same functions with a do block: julia> setrounding(BigFloat, RoundUp) do BigFloat(1) + parse(BigFloat0 码力 | 2007 页 | 6.73 MB | 3 月前3
Julia 1.11.5 DocumentationEvaluation Scope of Default Values . . . . . . . . . . . . . . . . . . . . . . . . . . 88 9.16 Do-Block Syntax for Function Arguments . . . . . . . . . . . . . . . . . . . . . . . . 88 9.17 Function composition encounter! help?> begin search: begin disable_sigint reenable_sigint begin begin...end denotes a block of code. If you already know Julia a bit, you might want to peek ahead at Performance Tips and Workflow the rounding can be changed only within the execution of a particular block of code by using the same functions with a do block:CHAPTER 5. INTEGERS AND FLOATING-POINT NUMBERS 27 julia> setrounding(BigFloat0 码力 | 2007 页 | 6.73 MB | 3 月前3
Julia 1.11.6 Release NotesEvaluation Scope of Default Values . . . . . . . . . . . . . . . . . . . . . . . . . . 88 9.16 Do-Block Syntax for Function Arguments . . . . . . . . . . . . . . . . . . . . . . . . 88 9.17 Function composition encounter! help?> begin search: begin disable_sigint reenable_sigint begin begin...end denotes a block of code. If you already know Julia a bit, you might want to peek ahead at Performance Tips and Workflow the rounding can be changed only within the execution of a particular block of code by using the same functions with a do block:CHAPTER 5. INTEGERS AND FLOATING-POINT NUMBERS 27 julia> setrounding(BigFloat0 码力 | 2007 页 | 6.73 MB | 3 月前3
julia 1.13.0 DEVEvaluation Scope of Default Values . . . . . . . . . . . . . . . . . . . . . . . . . . 88 9.16 Do-Block Syntax for Function Arguments . . . . . . . . . . . . . . . . . . . . . . . . 88 9.17 Function composition encounter! help?> begin search: begin disable_sigint reenable_sigint begin begin...end denotes a block of code. If you already know Julia a bit, you might want to peek ahead at Performance Tips and Workflow the rounding can be changed only within the execution of a particular block of code by using the same functions with a do block:CHAPTER 5. INTEGERS AND FLOATING-POINT NUMBERS 27 julia> setrounding(BigFloat0 码力 | 2058 页 | 7.45 MB | 3 月前3
Julia 1.12.0 RC1Evaluation Scope of Default Values . . . . . . . . . . . . . . . . . . . . . . . . . . 88 9.16 Do-Block Syntax for Function Arguments . . . . . . . . . . . . . . . . . . . . . . . . 88 9.17 Function composition encounter! help?> begin search: begin disable_sigint reenable_sigint begin begin...end denotes a block of code. If you already know Julia a bit, you might want to peek ahead at Performance Tips and Workflow the rounding can be changed only within the execution of a particular block of code by using the same functions with a do block:CHAPTER 5. INTEGERS AND FLOATING-POINT NUMBERS 27 julia> setrounding(BigFloat0 码力 | 2057 页 | 7.44 MB | 3 月前3
共 34 条
- 1
- 2
- 3
- 4













