defines or C vars visible to python?

Tom Morton tmorton at
Sat Mar 4 15:11:26 CET 2000


I'm writing a small colour ncurses module (in C) for a python project of mine.
I've had no real trouble apart from one point: Various colours are defined in
the module as:
#define COL_RED 1
Is there any way I can make these visible to python when the module is
imported, so instead of using numbers I can do this:

instead of:

I've probaby missed something in the Python/C api docs but it's driving me

Tom Morton, Drangband Maintainer:
Yikes Station, Frontier Elite 2 Fansite:

More information about the Python-list mailing list