在python中调用C库?

时间:2014-06-08 18:19:36

标签: python c++ numpy scipy cython

我想在python代码中调用C ++库中的函数,但我不知道应该怎么做。我想知道是否可以使用numpy.array作为C ++指针的输入,或者我是否需要修改它们以从python转移到C?

1 个答案:

答案 0 :(得分:0)

在stackoverflow上已经讨论过类似的问题。以下是其中一些:

  1. Calling C/C++ from python?
  2. Calling C functions in Python
  3. Wrapping a C library in Python: C, Cython or ctypes?
  4. 关于使用numpy.array作为C / C ++函数的输入,请在此处查看类似问题的答案: Passing Numpy arrays to a C function for input and output