#user-input #python #string #prompt

simple_input

一个简单的库,用于处理用户输入,灵感来自 Python

4 个版本 (破坏性更新)

使用旧的 Rust 2015

0.4.0 2018 年 12 月 2 日
0.3.0 2018 年 12 月 2 日
0.2.0 2018 年 12 月 2 日
0.1.0 2018 年 12 月 2 日

#123 in #user-input


rgc 中使用

MIT 许可证

3KB

简单输入

simple_input 提供了一种简单的方法来请求用户输入,灵感来自 Python 的 input 函数。

它只有一个函数,input(prompt: &str) -> String

extern crate simple_input;
use simple_input::input;
 
fn main() {
    let name = input("What is your name? ");
    println!("Hello {}!", name);
}

lib.rs:

简单输入

simple_input 提供了一种简单的方法来请求用户输入,灵感来自 Python 的 input 函数。

extern crate simple_input;
use simple_input::input;

fn main() {
    let name = input("What is your name? ");
    println!("Hello {}!", name);
}

没有运行时依赖