MCPcopy Create free account
hub / github.com/PyO3/pyo3 / run_python_script

Method run_python_script

pyo3-build-config/src/impl_.rs:870–876  ·  view source on GitHub ↗

Run a python script using the [`InterpreterConfig::executable`]. # Panics This function will panic if the [`executable`](InterpreterConfig::executable) is `None`.

(&self, script: &str)

Source from the content-addressed store, hash-verified

868 ///
869 /// This function will panic if the [`executable`](InterpreterConfig::executable) is `None`.
870 pub fn run_python_script(&self, script: &str) -> Result<String> {
871 run_python_script_with_envs(
872 Path::new(self.executable.as_ref().expect("no interpreter executable")),
873 script,
874 std::iter::empty::<(&str, &str)>(),
875 )
876 }
877
878 /// Run a python script using the [`InterpreterConfig::executable`] with additional
879 /// environment variables (e.g. PYTHONPATH) set.

Callers 2

test_run_python_scriptFunction · 0.80
mainFunction · 0.80

Calls 2

as_refMethod · 0.45

Tested by 1

test_run_python_scriptFunction · 0.64