Improve PyModule::from_code
examples
This commit is contained in:
parent
5b85c924dd
commit
ab7a65cbb5
|
@ -98,7 +98,7 @@ impl PyModule {
|
|||
/// let code = include_str!("../../assets/script.py");
|
||||
///
|
||||
/// Python::with_gil(|py| -> PyResult<()> {
|
||||
/// PyModule::from_code(py, code, "example", "example")?;
|
||||
/// PyModule::from_code(py, code, "example.py", "example")?;
|
||||
/// Ok(())
|
||||
/// })?;
|
||||
/// # Ok(())
|
||||
|
@ -117,7 +117,7 @@ impl PyModule {
|
|||
/// let code = std::fs::read_to_string("assets/script.py")?;
|
||||
///
|
||||
/// Python::with_gil(|py| -> PyResult<()> {
|
||||
/// PyModule::from_code(py, &code, "example", "example")?;
|
||||
/// PyModule::from_code(py, &code, "example.py", "example")?;
|
||||
/// Ok(())
|
||||
/// })?;
|
||||
/// Ok(())
|
||||
|
|
Loading…
Reference in a new issue