如何编译 C/C++ python 的函数
我有一个用 cpp 编写的源代码,我想对其进行编译并在 Python 中可读。 Python 必须提供 2 个文件名作为输入,并检索一个矩阵和一个向量作为输出。 如果我必须在 C/C++ 中执行此操作,我会使用 2 个字符和 2 个指针,但我不知道如何为 Python 语言查看已编译的 C/C++ 程序。
我希望有人能帮助我。 非常感谢。
I have a source code written in cpp that I want to compile and be readable in Python.
Python must give 2 filenames as input and retrieve a matrix and a vector as output.
If I had to do it in C/C++ I'd use 2 chars and 2 pointers but I don't know how a compiled C/C++ program can be seen for Python language.
I hope that someone can help me.
Thank you very much.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试使用 Swig 生成从 Python 调用 C/C++ 代码所需的粘合代码。这比自己编写代码更容易。
Try using Swig to generate the glue code necessary to call C/C++ code from Python. It's easier than writing the code yourself.