inline-python 0.5.1

Inline Python code directly in your Rust code
Documentation
#![feature(proc_macro_hygiene)]

use inline_python::pyo3::{prelude::*, wrap_pyfunction};
use inline_python::{python, Context};

#[pyfunction]
fn rust_print(x: i32) {
	println!("rust: x = {}", x);
}

fn main() {
	let c = Context::new();

	c.add_wrapped(wrap_pyfunction!(rust_print));

	c.run(python! {
		x = 123
		print("python: x =", x)
		rust_print(x)
	});
}