How can I reference #defines in a C file from python?

前端 未结 5 1703
星月不相逢
星月不相逢 2020-12-30 10:45

I have a C file that has a bunch of #defines for bits that I\'d like to reference from python. There\'s enough of them that I\'d rather not copy them into my python code, i

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-30 11:27

    If you're writing an extension module, use http://docs.python.org/3/c-api/module.html#PyModule_AddIntMacro

提交回复
热议问题