py_embed 0.0.1
py_embed: ^0.0.1 copied to clipboard
Embed CPython in Dart applications using native FFI bindings to the Python C API.
example/main.dart
import 'package:py_embed/py_embed.dart';
void main() async {
final python = Python();
python.initFromConfig(
PyConfig()
..executable = await getPythonExecutable()
..programName = await getPythonExecutable(),
);
python.runSimpleString('print("Hello from Python!")');
python.dispose();
}