Tornado 6.5 Documentation
Application([ (r"/", MainHandler), ]) async def main(): app = make_app() app.listen(8888) await asyncio.Event().wait() if __name__ == "__main__": asyncio.run(main()) This example does not use any of Tornado’s Python web frameworks. It is not based on WSGI, and it is typically run with only one thread per process. See the User’s guide for more on Tornado’s approach to asynchronous programming. While some support supported or recommended for pro- duction use. Some features are missing on Windows (including multi-process mode) and scalability is limited (Even though Tornado is built on asyncio, which supports Windows0 码力 | 272 页 | 1.12 MB | 2 月前3Tornado 6.5 Documentation
MainHandler), ]) async def main(): app = make_app() app.listen(8888) await asyncio.Event().wait()if __name__ == "__main__": asyncio.run(main()) This example does not use any WSGI [https://wsgi.readthedocs.io/en/latest/], and it is typically run with only one thread per process. See the User’s guide for more on Tornado’s approach to asynchronous programming. While some support supported or recommended for production use. Some features are missing on Windows (including multi-process mode) and scalability is limited (Even though Tornado is built on asyncio, which supports Windows0 码力 | 437 页 | 405.14 KB | 2 月前3Rust 程序设计语言 简体中文版 1.85.0
程序 接下来,新建一个源文件,命名为 main.rs。Rust 源文件总是以 .rs 扩展名结尾。如果文件名 包含多个单词,那么按照命名习惯,应当使用下划线来分隔单词。例如命名为 hello_world.rs, 而不是 helloworld.rs。 现在打开刚创建的 main.rs 文件,输入示例 1-1 中的代码。 文件名:main.rs fn main() { println!("Hello 上,输 入如下命令,编译并运行文件: 15/562Rust 程序设计语言 简体中文版 $ rustc main.rs $ ./main Hello, world! 在 Windows 上,输入命令 .\main.exe,而不是 ./main: > rustc main.rs > .\main Hello, world! 不管使用何种操作系统,终端应该打印字符串 Hello, world!。如果没有看到这些输出,回到 程序的结构 现在,让我们回过头来仔细看看这个 “Hello, world!” 程序。这是第一块拼图: fn main() { } 这几行定义了一个名叫 main 的函数。main 函数是一个特殊的函数:在可执行的 Rust 程序中, 它总是最先运行的代码。第一行代码声明了一个叫做 main 的函数,它没有参数也没有返回值。 如果有参数的话,它们的名称应该出现在小括号 () 中。 函数体被包裹在0 码力 | 562 页 | 3.23 MB | 9 天前3
共 3 条
- 1