title: Convert Python dictionary into C like structure
body: <p>I am a newbie in Python and C and I would like to know how to put dictionary elements into a C like structure (struct).</p>
  
  <p>For example, here is my structure:</p>
  
  <pre><code>typedef struct
  {
      int dim;
      float *Tab1;
      float *Tab2;
  }  
  Tableaux;
  </code></pre>
  
  <p>Here is my dictionary in Python:</p>
  
  <pre><code>Tableaux = {}
  Tableaux["dim"]=None
  Tableaux["Tab1"]=[]
  Tableaux["Tab2"]=[]
  </code></pre>
  
  <p>Here is my interface function:</p>
  
  <pre><code>static PyObject* py_initTab(PyObject* self, PyObject* args)
  {
      PyObject* dict;
      Tableaux Tab;
      if (!PyArg_ParseTuple(args, "O!", &amp;dict))  
          return NULL;        
  
       Tab.Tab1=dict["Tab1"]; // How could I do something like that?      
  
       return Py_BuildValue("");
  }
  </code></pre>