Tornado 6.5 Documentation
your own BaseHandler instead of RequestHandler for all your specific handlers. Handling request input The request handler can access the object representing the current request with self.request. See def get(self): self.write('') def post(self): self uploaded via a form are available in self.request.files, which maps names (the name of the HTML <input type="file"> element) to a list of files. Each file is a dictionary of the form {"filename":..., "content_type":0 码力 | 272 页 | 1.12 MB | 2 月前3Tornado 6.5 Documentation
application The main coroutine The Application object Subclassing RequestHandler Handling request input Overriding RequestHandler methods Error Handling Redirection Asynchronous handlers Templates and your own BaseHandler instead of RequestHandler for all your specific handlers. Handling request input The request handler can access the object representing the current request with self.request. See write('')0 码力 | 437 页 | 405.14 KB | 2 月前3Rust 程序设计语言 简体中文版 1.85.0
文件名:src/main.rs use std::io; fn main() { println!("Guess the number!"); println!("Please input your guess."); let mut guess = String::new(); io::stdin() .read_line(&mut guess) 作为函数体的开始。 第一章也提及了 println! 是一个在屏幕上打印字符串的宏: println!("Guess the number!"); println!("Please input your guess."); 这些代码仅仅打印提示,介绍游戏的内容然后请求用户输入。 使用变量储存值 接下来,创建一个 变量(variable)来储存用户输入,像这样: 23/562Rust debuginfo] target(s) in 6.44s Running `target/debug/guessing_game` Guess the number! Please input your guess. 6 You guessed: 6 至此为止,游戏的第一部分已经完成:我们从键盘获取输入并打印了出来。 生成一个秘密数字 接下来,需要生成一个秘密数字,好让用户来猜。秘密数字应该每次都不同,这样重复玩才不0 码力 | 562 页 | 3.23 MB | 10 天前3
共 3 条
- 1