dartpy 0.0.4 copy "dartpy: ^0.0.4" to clipboard
dartpy: ^0.0.4 copied to clipboard

A library for using dart with python via python's C API

example/dartpy_example.dart

import 'dart:ffi';

import 'package:dartpy/dartpy.dart';
import 'package:ffi/ffi.dart';

void main(List<String> args) {
  dartpyc.Py_Initialize();
  final python = '''
from time import time, ctime
print("Today is", ctime(time()))
''';
  final pystring = python.toNativeUtf8();
  dartpyc.PyRun_SimpleString(pystring.cast<Char>());
  malloc.free(pystring);
  print(dartpyc.Py_FinalizeEx());
}
50
likes
120
points
146
downloads

Publisher

verified publishertimwhiting.dev

Weekly Downloads

A library for using dart with python via python's C API

Repository
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

args, ffi, freezed_annotation, path

More

Packages that depend on dartpy