closing_stream/
closing_stream.rs

1use interactive_process::InteractiveProcess;
2use std::process::Command;
3
4fn main() {
5    let mut cmd = Command::new("examples/closing_stream.py");
6    let proc = InteractiveProcess::new_with_exit_callback(
7        &mut cmd,
8        |line| {
9            println!("Got: {}", line.unwrap());
10        },
11        || println!("Child exited."),
12    )
13    .unwrap();
14
15    println!("{}", proc.wait().unwrap());
16}