I have a legacy C library that creates a tree of objects. I would like to convert the tree into a pre-existing Python class. How do I create the PyObject for that class?

我有一个遗留的C库,可以创建一个对象树。我想将树转换为预先存在的Python类。如何为该类创建PyObject?

3 个解决方案

#1


Cython is capable of doing this. It's a semi-fork of Pyrex, and it can wrap existing data structures and expose them to Python. In fact, this is one of the sections in the user guide. Cython is relatively easy to use, and it includes an HTML-output format that shows all the generated code as well as highlighted hot spots where optimization could be applied.

Cython能够做到这一点。它是Pyrex的半分支,它可以包装现有的数据结构并将它们暴露给Python。实际上,这是用户指南中的一个部分。 Cython相对易于使用,它包含一个HTML输出格式,显示所有生成的代码以及可以应用优化的突出显示的热点。

更多相关文章

  1. 《数据结构与算法Python语言描述》裘宗燕 笔记 第五章 栈和队列
  2. Linux内核数据结构之链表
  3. java数据结构--链表
  4. 数据结构:关于重建二叉树的三种思路
  5. “树”不倒,人不散—数据结构的核心
  6. 如何使用Thymleaf做到这一点?
  7. 数据结构学习----线性表(Java版的实现)
  8. java入门---数据结构操作实例之获取链表的元素
  9. 数据结构-java与c实现带头结点的单链表

随机推荐

  1. c语言中合法标识符有哪些
  2. C语言有几种注释方式
  3. C++在构造函数中使用new时,需要注意这些事
  4. 在什么语言中字符串以\0标志字符串的结
  5. 声明动态数组的语句怎么写
  6. 详解C++虚成员函数和动态联编
  7. c语言中文本输出的函数名称是什么?
  8. c语言函数声明格式是什么?
  9. c语言绝对值怎么表示
  10. c语言中逻辑运算符优先级是什么?