Philip Semanchuk schrieb: > This works for me: > PyModule_AddIntConstant(module, "O_CREAT", O_CREAT); > > I've had to learn a lot about writing extensions from looking at the > Python source code. Lots of valuable tricks to be learned there.
This trick makes it even easier: #ifndef PyModule_AddIntMacro #define PyModule_AddIntMacro(m, c) PyModule_AddIntConstant(m, #c, c) #endif if (!PyModule_AddIntMacro(mod, O_CREAT)) return; Christian -- http://mail.python.org/mailman/listinfo/python-list