This repository has been archived on 2024-10-16. You can view files and clone it, but cannot push or open issues or pull requests.
pt/members/libpt-py/src/core/printing.rs

25 lines
616 B
Rust
Raw Normal View History

2024-03-01 20:15:16 +01:00
use pyo3::prelude::*;
use libpt::core::printing as origin;
/// Quickly get a one line visual divider
#[pyfunction]
pub fn divider() -> String {
origin::divider()
}
/// Quickly print a one line visual divider
#[pyfunction]
pub fn print_divider() {
origin::print_divider()
}
/// implement a python module in Rust
pub fn submodule(py: Python, parent: &PyModule) -> PyResult<()> {
let module = PyModule::new(py, "printing")?;
module.add_function(wrap_pyfunction!(divider, module)?)?;
module.add_function(wrap_pyfunction!(print_divider, module)?)?;
parent.add_submodule(module)?;
Ok(())
}