title: Python-C integration: Ctypes, CFFI or create a Binary Module
body: <p>Basically I want to make a Python program call functions written in C.</p>
  
  <p>So (as far as I know) my options are:</p>
  
  <ul>
  <li><strong>CTypes/<a href="http://cffi.readthedocs.org/" rel="noreferrer">CFFI</a></strong>
  
  <ul>
  <li>Create a DLL/SO/DyLib containing the C functions and access them using CTypes or <a href="http://cffi.readthedocs.org/" rel="noreferrer">CFFI</a>. Apparently <a href="http://cffi.readthedocs.org/" rel="noreferrer">CFFI</a> is way faster with the only drawback of having to declare in python all the functions signatures.</li>
  <li><strong>Pros:</strong>
  
  <ul>
  <li>Don't have to make any adaptation in my C functions. All type-translation is done in Python.</li>
  </ul></li>
  <li><strong>Cons:</strong>
  
  <ul>
  <li>Performance ?</li>
  </ul></li>
  </ul></li>
  <li><strong>Python Binary Module</strong>
  
  <ul>
  <li>Write a python interface in C, converting my C module into a binary python module</li>
  <li><strong>Pros:</strong>
  
  <ul>
  <li>Performance ?</li>
  </ul></li>
  <li><strong>Cons:</strong>
  
  <ul>
  <li>All type-translation is done in C. Using [SIP][3] this might be automated.</li>
  </ul></li>
  </ul></li>
  </ul>
  
  <hr>
  
  <p>Convert the C module into a python binary module is really faster ?</p>
  
  <p>Does both solutions support sending python callbacks to C functions ?</p>
  
  <p>Is SIP a good option to generate a python interface ? Are there any other options ?</p>
  
  <p>Are there any other particularities in any of them ?</p>