when running the hello_embed.rs example on windows, it works fine but I don't see the output Hello World! (which I would expect from the python statement print("Hello World!")). Should rustpython print to stdout when python calls print? Or do I have to redirect that somehow?
Thanks!
The text was updated successfully, but these errors were encountered:
use rustpython::rustpython_vm as vm;
fn main() -> vm::PyResult<()> {
vm::Interpreter::default().enter(|vm| {
let scope = vm.new_scope_with_builtins();
let code_obj = vm
.compile(
r#"print("Hello World!")"#,
vm::compile::Mode::Exec,
"<embedded>".to_owned(),
)
.map_err(|err| vm.new_syntax_error(&err))?;
println!("start");
vm.run_code_obj(code_obj, scope)?;
println!("end");
Ok(())
})
}
results in
cargo run
Compiling pytest v0.1.0 (C:\Users\Dakun\Downloads\_stuff\code\rust\pytest)
Finished dev [unoptimized + debuginfo] target(s) in 2.56s
Running `target\debug\pytest.exe`
start
end
Hi,
when running the hello_embed.rs example on windows, it works fine but I don't see the output
Hello World!
(which I would expect from the python statementprint("Hello World!")
). Should rustpython print to stdout when python calls print? Or do I have to redirect that somehow?Thanks!
The text was updated successfully, but these errors were encountered: