python-input 0.8.0

A rust implementation of the python 'input' function.
Documentation
  • Coverage
  • 50%
    1 out of 2 items documented0 out of 1 items with examples
  • Size
  • Source code size: 3.47 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 104.67 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • maxslarsson/python-input
    3 2 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • maxslarsson

python-input

A simple pure-rust implementation of python's input function.

Functions

There is currently only one function, the input function.

Input Function

The input function takes one parameter, a string which is printed to the console as a prompt to the user.

Example Code

Add the following to your Cargo.toml file

[dependencies]
...
python-input = "0.8.0"
...

Add the following to your rust file(s)

extern crate python_input;

use python_input::input;

fn main() {
  let name = input("What is your name? ");
  let age = input("How old are you? ");

  println!("Hello {}, you are {} years old.", name, age);
}