title: Python ctypes: passing to function with 'const char ** ' argument
body: <p>I want to pass a python list of strings to a C function expecting const char **. I saw the question and solution <a href="https://stackoverflow.com/questions/3494598/passing-a-list-of-strings-to-from-python-ctypes-to-c-function-expecting-char">here</a> but it does not seem to work for me. The following sample code:</p>
  
  <pre><code>argList = ['abc','def']
  options = (ctypes.c_char_p * len(argList))()
  options[:] = argList
  </code></pre>
  
  <p>gives the following error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;interactive input&gt;", line 1, in &lt;module&gt;
  TypeError: string or integer address expected instead of str instance
  </code></pre>
  
  <p>What am I doing wrong?</p>
  
  <hr>
  
  <p>Addendum:</p>
  
  <p>There seems to be a consensus, that this code should work. Here is how to reproduce the problem.</p>
  
  <p>The following four lines typed in my Python command-line illustrate my problem.</p>
  
  <pre><code>Python 3.2 (r32:88445, Feb 20 2011, 21:29:02) [MSC v.1500 32 bit (Intel)] on win
  32
  Type "help", "copyright", "credits" or "license" for more information.
  &gt;&gt;&gt; from ctypes import *
  &gt;&gt;&gt; argList = ['abc', 'def']
  &gt;&gt;&gt; options = (c_char_p * len(argList))()
  &gt;&gt;&gt; options[:] = argList
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  TypeError: string or integer address expected instead of str instance
  &gt;&gt;&gt;
  </code></pre>