MCPcopy Create free account
hub / github.com/dgrunwald/rust-cpython / run

Method run

src/python.rs:265–273  ·  view source on GitHub ↗

Executes one or more Python statements in the given context. If `globals` is `None`, it defaults to Python module `__main__`. If `locals` is `None`, it defaults to the value of `globals`.

(
        self,
        code: &str,
        globals: Option<&PyDict>,
        locals: Option<&PyDict>,
    )

Source from the content-addressed store, hash-verified

263 /// If `globals` is `None`, it defaults to Python module `__main__`.
264 /// If `locals` is `None`, it defaults to the value of `globals`.
265 pub fn run(
266 self,
267 code: &str,
268 globals: Option<&PyDict>,
269 locals: Option<&PyDict>,
270 ) -> PyResult<()> {
271 self.run_code(code, ffi::Py_file_input, globals, locals)?;
272 Ok(())
273 }
274
275 /// Runs code in the given context.
276 /// `start` indicates the type of input expected:

Callers 11

instance_methodFunction · 0.80
class_methodFunction · 0.80
class_method_with_argsFunction · 0.80
static_methodFunction · 0.80
static_method_with_argsFunction · 0.80
static_dataFunction · 0.80
gc_integrationFunction · 0.80
class_with_visibilityFunction · 0.80
test_thread_exit_pyFunction · 0.80

Calls 1

run_codeMethod · 0.80

Tested by 11

instance_methodFunction · 0.64
class_methodFunction · 0.64
class_method_with_argsFunction · 0.64
static_methodFunction · 0.64
static_method_with_argsFunction · 0.64
static_dataFunction · 0.64
gc_integrationFunction · 0.64
class_with_visibilityFunction · 0.64
test_thread_exit_pyFunction · 0.64