pub fn spawn_python() -> Result<ReplSession<OsSession>, Error>Expand description
Spawn default python’s IDLE.
Examples found in repository?
examples/python.rs (line 8)
7fn main() {
8 let mut p = spawn_python().unwrap();
9
10 p.execute("import platform").unwrap();
11 p.send_line("platform.node()").unwrap();
12
13 let found = p.expect(Regex(r"'.*'")).unwrap();
14
15 println!(
16 "Platform {}",
17 String::from_utf8_lossy(found.get(0).unwrap())
18 );
19}