Tornado 6.5 Documentation
WORLD Here is a simple “Hello, world” example web app for Tornado: import asyncio import tornado class MainHandler(tornado.web.RequestHandler): def get(self): self.write("Hello, world") def make_app(): generator as the result of the yield expression. Most asyn- chronous code never touches the Future class directly except to immediately pass the Future returned by an asyn- chronous function to a yield expression def remove_fragment(url): pure_url, frag = urldefrag(url) return pure_url def get_links(html): class URLSeeker(HTMLParser): def __init__(self): HTMLParser.__init__(self) self.urls = [] def handle_starttag(self0 码力 | 272 页 | 1.12 MB | 2 月前3Tornado 6.5 Documentation
world Here is a simple “Hello, world” example web app for Tornado: import asyncio import tornado class MainHandler(tornado.web.RequestHandler): def get(self): self.write("Hello, world") generator as the result of the yield expression. Most asynchronous code never touches the Future class directly except to immediately pass the Future returned by an asynchronous function to a yield expression remove_fragment(url): pure_url, frag = urldefrag(url) return pure_url def get_links(html): class URLSeeker(HTMLParser): def __init__(self): HTMLParser.__init__(self)0 码力 | 437 页 | 405.14 KB | 2 月前3Rust 程序设计语言 简体中文版 1.85.0
match 表达式和 if let 控 制流结构。在 Rust 中,创建自定义类型需要用到结构体和枚举。 第七章介绍 Rust 的模块(module)系统,其中的私有性规则用来组织代码和公开的 API(应 用程序接口)。第八章讨论标准库提供的常见集合数据结构,例如 Vector(向量)、字符串和 Hash Map(散列表)。第九章探索 Rust 的错误处理的理念与技术。 第十章深入介绍泛型(generic)、Trait rustup doc 在浏览器中查看本地 文档。 任何时候,如果你拿不准标准库中的类型或函数的用途和用法,请查阅应用程序接口 (application programming interface,API)文档! 文本编辑器和集成开发环境(Integrated Development Environments, IDE) 本书不会假设你使用何种工具来编写 Rust 代码。几乎任何文本编辑器都可以搞定!然而,很 的简写,它表示任何至少是 0.8.5 但小于 0.9.0 的版本。 Cargo 认为这些版本与 0.8.5 版本的公有 API 相兼容,这样的版本指定确保了我们可以获取 能使本章代码编译的最新的补丁(patch)版本。任何大于等于 0.9.0 的版本不能保证和接下 来的示例采用了相同的 API。 现在,不修改任何代码,构建项目,如示例 2-2 所示。 $ cargo build Updating crates0 码力 | 562 页 | 3.23 MB | 9 天前3
共 3 条
- 1