Python cairo and XCB support

Tuesday 22 December 2009 Python, Cairo, XCB, xpyb Comments Follow Me

cairo has a Python binding (pycairo) since a long time, and some months ago a Python binding for XCB (xpyb) has been released.

Pycairo has no support for creating Xlib surfaces. You can get a Xlib surface from PyGTK and then use Pycairo to draw on it, but there's no way to create one directly.

What I've done is make Pycairo aware of xpyb so it can creates directly an XCB surface from a XCB connection and a drawable.

As said in my mail to the XCB list, I'm now waiting for a review before pushing this upstream. :-)

For the first time, I guess, XCB has beat Xlib support! ;-)

Check out The Hacker's Guide to Python!

This is a book I wrote talking about designing Python applications, state of the art, advice to apply when building your application, various Python tips, etc. Interested?


Get notified of my next blog post