I want to use Pango with the Cairo backend in Python 3. I chose 'cairocffi' for reasons that are not relevant here. I am trying to run the example in the documentation. It calls Pango through CFFI. The very beginning of the example
import cairocffi
import cffi
ffi = cffi.FFI()
ffi.include(cairocffi.ffi)
gives the following error.
File "/usr/lib/python3.6/site-packages/cffi/api.py", line 494, in include
type(ffi_to_include).__name__,))
TypeError: ffi.include() expects an argument that is also of type cffi.FFI, not 'CompiledFFI'
I have been trying to understand the CFFI documentation, but I am completely lost. First, where is CompiledFFI
documented? Second, why do not I see include
, cdef
, set_source
methods in the FFI
interface? And the main question is, what am I doing wrong?