On Sun, 04 Jan 2009 21:05:14 +0100 Christian Heimes <li...@cheimes.de> wrote:
> 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. Thanks, that's perfect. I see it is documented, but I didn't know where to look. > This trick makes it even easier: > > #ifndef PyModule_AddIntMacro > #define PyModule_AddIntMacro(m, c) PyModule_AddIntConstant(m, #c, c) > #endif Good idea, but I'm a lot more experienced with C in general than in interfacing it with python, so I already thought of it :-). -- TH * http://www.realh.co.uk -- http://mail.python.org/mailman/listinfo/python-list