title: Cython: Convert Python string list to 2D character array
body: <p>I am trying to convert a list of python strings to a 2D character array, and then pass it into a C function.</p>
  
  <p>Python version: 3.6.4, Cython version: 0.28.3, OS Ubuntu 16.04</p>
  
  <p>My first try looks like this:</p>
  
  <pre><code>def my_function(name_list):
      cdef char name_array[50][30]
  
      for i in range(len(name_list)):
          name_array[i] = name_list[i]
  </code></pre>
  
  <p>The code builds, but during runtime I receive the following response:</p>
  
  <pre><code>Traceback (most recent call last):
    File "test.py", line 532, in test_my_function
      my_function(name_list)
    File "my_module.pyx", line 817, in my_module.my_function
    File "stringsource", line 93, in 
  carray.from_py.__Pyx_carray_from_py_char
  IndexError: not enough values found during array assignment, expected 25, got 2
  </code></pre>
  
  <p>I then tried to make sure that the string on the right-hand side of the assignment is exactly 30 characters by doing the following:</p>
  
  <pre><code>def my_function(name_list):
      cdef char name_array[50][30]
  
      for i in range(len(name_list)):
          name_array[i] = (name_list[i] + ' '*30)[:30]
  </code></pre>
  
  <p>This caused another error, as follows:</p>
  
  <pre><code>Traceback (most recent call last):
    File "test.py", line 532, in test_my_function
      my_function(name_list)
    File "my_module.pyx", line 818, in my_module.my_function
    File "stringsource", line 87, in carray.from_py.__Pyx_carray_from_py_char
  TypeError: an integer is required
  </code></pre>
  
  <p>I will appreciate any help. Thanks.</p>