Accessing "variables" in an extension module

Christian Wermuth christian at integration-x.com
Fri Dec 8 15:50:15 CET 2000


arcege at shore.net wrote:

> ...
> I'm assuming that you want to have predefined variables and constants.
> You might want to look at the section 'Adding "constants"' (which, in
> Python, are really variables anyway) in the "Python Extension writing"
> document.  That might help you.
>
> The URL for the document is
> <URL: http://starship.python.net/crew/arcege/extwriting/pyext.html>
>
> Remember that modules, whether a C extension or not, are mutable and
> you can always add or remove names there.
>
>   -Arcege

Thanks. It was a great help.
Now I can access variables in the "init" section of my C code, but I can't
figure out how to do it from my method. I can set and read the variable
from python, but when I try to access the variable from my C method, I just
get a value of "null". Any idea?

Christian




More information about the Python-list mailing list