Function plotpy::call_python3[][src]

pub fn call_python3(
    python_commands: &str,
    output_dir: &str,
    filename_py: &str
) -> Result<String>
Expand description

Writes a python file and call python3 on it

Arguments

  • python_commands - Python commands to be written to file
  • output_dir - Output directory to be created
  • filename_py - Filename with extension .py

Note

The contents of PYTHON_HEADER are added at the beginning of the file.

Examples

use plotpy::*;
let res = call_python3("print(\"Hello World!\")", "/tmp/plotpy", "commands.py").unwrap();
assert_eq!(res, "Hello World!\n".to_string());