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!

Want to know more about writing good and performant Python code? Read The Hacker's Guide to Python and learn about designing Python applications, scalability, state of the art, advice to apply when building your application, tips and even hacker interviews, etc. Interested?

Download The Hacker's Guide to Python

Get notified of my next blog post