Created
November 11, 2021 16:49
-
-
Save oconnor663/4b7b58a23b14292b026fdf2be3ed3ceb to your computer and use it in GitHub Desktop.
duct example for https://github.com/oconnor663/duct.rs/issues/99
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const PYTHON_PROGRAM: &str = r#" | |
| import sys | |
| print("something for stdout") | |
| print("something for stderr", file=sys.stderr) | |
| "#; | |
| fn main() { | |
| let logf = std::fs::File::create("logfile.txt").unwrap(); | |
| duct::cmd!("python", "-c", PYTHON_PROGRAM) | |
| .stderr_to_stdout() | |
| .unchecked() | |
| .stdout_file(logf) | |
| .run() | |
| .unwrap(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment