相关疑难解决方法(0)

快速字符串数组 - Cython

有以下假设代码:

cdef extern from "string.h":
    int strcmp(char* str1, char* str2)

def foo(list_str1, list_str2):
    cdef unsigned int i, j
    c_arr1 = ??
    c_arr2 = ??
    for i in xrange(len(list_str1)):
        for j in xrange(len(list_str2)):
            if not strcmp(c_arr1[i], c_arr2[j]):
                do some funny stuff
Run Code Online (Sandbox Code Playgroud)

有没有办法将列表转换为c数组?

我已经阅读并尝试过Cython - 将字符串列表转换为char**,但这只会引发错误.

python arrays string python-2.x cython

10
推荐指数
2
解决办法
5793
查看次数

标签 统计

arrays ×1

cython ×1

python ×1

python-2.x ×1

string ×1