Author: Maciej Fijalkowski <fij...@gmail.com> Branch: extradoc Changeset: r4237:549b9fe51082 Date: 2012-06-30 22:03 +0200 http://bitbucket.org/pypy/extradoc/changeset/549b9fe51082/
Log: example code diff --git a/talk/ep2012/stm/talk.rst b/talk/ep2012/stm/talk.rst --- a/talk/ep2012/stm/talk.rst +++ b/talk/ep2012/stm/talk.rst @@ -176,8 +176,17 @@ CFFI slide ---------- -* XXX a bit of example code +some example code:: + >>> from cffi import FFI + >>> ffi = FFI() + >>> ffi.cdef(""" + ... int printf(const char *format, ...); + ... """) + >>> C = ffi.dlopen(None) + >>> arg = ffi.new("char[]", "world") + >>> C.printf("hi there, %s!\n", arg) + hi there, world! STM --- _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit