Merge pull request #3249 from lucatrv/patch-1
Improve `PyModule::from_code` examples
This commit is contained in:
commit
7e61f18751
|
@ -98,7 +98,7 @@ impl PyModule {
|
||||||
/// let code = include_str!("../../assets/script.py");
|
/// let code = include_str!("../../assets/script.py");
|
||||||
///
|
///
|
||||||
/// Python::with_gil(|py| -> PyResult<()> {
|
/// Python::with_gil(|py| -> PyResult<()> {
|
||||||
/// PyModule::from_code(py, code, "example", "example")?;
|
/// PyModule::from_code(py, code, "example.py", "example")?;
|
||||||
/// Ok(())
|
/// Ok(())
|
||||||
/// })?;
|
/// })?;
|
||||||
/// # Ok(())
|
/// # Ok(())
|
||||||
|
@ -117,7 +117,7 @@ impl PyModule {
|
||||||
/// let code = std::fs::read_to_string("assets/script.py")?;
|
/// let code = std::fs::read_to_string("assets/script.py")?;
|
||||||
///
|
///
|
||||||
/// Python::with_gil(|py| -> PyResult<()> {
|
/// Python::with_gil(|py| -> PyResult<()> {
|
||||||
/// PyModule::from_code(py, &code, "example", "example")?;
|
/// PyModule::from_code(py, &code, "example.py", "example")?;
|
||||||
/// Ok(())
|
/// Ok(())
|
||||||
/// })?;
|
/// })?;
|
||||||
/// Ok(())
|
/// Ok(())
|
||||||
|
|
Loading…
Reference in New Issue