小编xel*_*lez的帖子

Cython - 将字符串列表转换为char**

如何将python字符串的python列表转换为空终止,char**以便将其传递给外部C函数?

我有:

struct saferun_task:
    saferun_jail   *jail
    saferun_limits *limits

    char **argv
    int stdin_fd  
    int stdout_fd
    int stderr_fd

int saferun_run(saferun_inst *inst, saferun_task *task, saferun_stat *stat)
Run Code Online (Sandbox Code Playgroud)

在cdef extern块中

我希望将类似的内容转换('./a.out', 'param1', 'param2') 为我可以指定的内容saferun_task.argv

怎么样?

arrays list cython

6
推荐指数
1
解决办法
3266
查看次数

标签 统计

arrays ×1

cython ×1

list ×1