call static function from extension module - syntaxerror

Discussion in 'Python' started by Todd, Dec 23, 2005.

  1. Todd

    Todd Guest


    I'm working right from the example here to make a basic extenstion

    I can load my module into python and dir shows my function. But I get
    a syntax error if I try to access it.
    File "<stdin>", line 1
    SyntaxError: invalid syntax

    However, I can get at it using getattr. I tried compiling myself and
    using setup. My method is defined as

    static PyMethodDef ast_man_methods[] = {
    {"exec",exec,METH_VARARGS,"Execute Asterisk commands."},

    What might be my problem??

    Todd, Dec 23, 2005
    1. Advertisements

  2. exec is a reserved word.
    File "<stdin>", line 1
    exec = 1
    SyntaxError: invalid syntax
    Erik Max Francis, Dec 23, 2005
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.