SWIG does not convert arrays to Python lists automatically. Since you are using C++, use std::string and std::vector for your f, then SWIG will make all the necessary conversions automatically (don't forget to include "std_vector.i" and such, see the SWIG docs):
void f(std::vector<std::string> > strs)
If you cannot modify the declaration of f, you can create an %inline wrapper in the .i:
%inline {
void f(const std::vector<std::string> >& strs)
{
// create tmpCharArray of type char*[] from strs
const char* tmpCharArray[] = new const char* [strs.size()];
for (i=0; i<strs.size(); i++)
tmpCharArray[i] = strs[i].c_str();
f(tmpCharArray);
delete[] tmpCharArray;
}
}
f function, it takes thechar []list and you givenlist of string. So callf functionwithchar list.