Replies: 1 comment 1 reply
-
if the source is file, let module = vm.import(<path>)?;
let hello - module.get_attr("hello")?;
vm.invoke(hello, vm.new_pyobj("string"))?; |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
How do I add this function or module to the VM and call it with an argument?
I found https://github.com/RustPython/RustPython/blob/main/examples/mini_repl.rs#L16 but this is only for compile time python programs. Mine is runtime. I tried all possible methods of the vm, tried setting attributes, etc. I can run source code but cannot call functions inside of it, with arguments, etc.
Beta Was this translation helpful? Give feedback.
All reactions