Kaushik Ghose

All your genome are belong to us

Why would I ever write in C?

I’ve made computers do tricks in both C/C++ and Python for many years now. For the past few years I’ve written exclusively in Python for both work and play. I … Continue reading

May 9, 2015 · 2 Comments

Cython __cinit__

cdef classes are awesome if you want lightweight data structures, for example, when you need millions of them. These cython classes have some special methods, the most basic of which … Continue reading

March 8, 2015 · Leave a comment

How to shoot yourself in the foot with Cython

If you’ve grown fat and complacent using Python, try a little Cython. It’ll put hair on your chest and take some off your scalp. Take the following Cython code I … Continue reading

December 10, 2014 · Leave a comment

Get more out of Cython

Getting more out of your Cython code doesn’t have to be a black art. A key step is to peek into the cythonized .c file and note if inner loops … Continue reading

December 8, 2014 · Leave a comment

Python setuptools entry points

This is a quick tutorial on how to use Python setup tools entry points to elegantly distribute command line scripts as part of your program, and to enable your code … Continue reading

November 25, 2014 · Leave a comment

The Felix problem

Say you have a multiplayer game where there is no central server. You need to indicate to a pair of players if they are within a certain distance from each … Continue reading

November 8, 2014 · Leave a comment


Ok, so it doesn’t have as nice a ring to it as “Cythonize!” but the Python C-Foreign Function Interface blew my mind away. I had previously used Cython to write … Continue reading

October 25, 2014 · Leave a comment

Get every new post delivered to your Inbox.

Join 52 other followers