title: Example program of Cython as Python to C Converter
body: <p>I found <a href="https://stackoverflow.com/questions/7112812/use-cython-as-python-to-c-converter">here</a> and <a href="https://stackoverflow.com/questions/4650243/convert-python-program-to-c-c-code">here</a> that one can use Cython to convert Python to C, but I cannot find any step-by-step example. Let's say I have a simple function:</p>
  
  <p><strong>foo.pyx</strong></p>
  
  <pre><code>cdef void foo(double* x):
     x[0] = 0.0
  </code></pre>
  
  <p><strong>setup.py</strong></p>
  
  <pre><code>from distutils.core import setup
  from Cython.Build import cythonize
  
  setup(
      ext_modules = cythonize("foo.pyx")
  )
  </code></pre>
  
  <p>then I run: <strong>python setup.py build_ext --inplace</strong> to get foo.c and foo.so files (and build directory). Well, I would like to use translated (I hope) foo function in main.c. What should I put into main.c file and how to compile it in order to be able to use foo function? I am using gcc.</p>