我有一个C函数,它期望list\0终止的字符串作为输入:
void external_C( int length , const char ** string_list) {
// Inspect the content of string_list - but not modify it.
}
Run Code Online (Sandbox Code Playgroud)
从python(使用ctypes)我想基于python字符串列表调用此函数:
def call_c( string_list ):
lib.external_C( ?? )
call_c( ["String1" , "String2" , "The last string"])
Run Code Online (Sandbox Code Playgroud)
有关如何在python端构建数据结构的任何提示?注意我保证C函数不会改变string_list中字符串的内容.
问候
乔金 -