[Python] ctypes - Beginner

Discussão em 'Python' iniciado por Stack, Outubro 5, 2024.

  1. Stack

    Stack Membro Participativo

    I have the task of "wrapping" a c library into a python class. The docs are incredibly vague on this matter. It seems they expect only advanced python users would implement ctypes.

    Some step by step help would be wonderful.

    So I have my c library. What do I do? What files do I put where? How do I import the library? I read that there might be a way to "auto wrap" to Python?

    (By the way I did the ctypes tutorial on python.net and it doesn't work. Meaning I'm thinking they are assuming I should be able to fill in the rest of the steps.)

    In fact this is the error I get with their code:

    File "importtest.py", line 1
    >>> from ctypes import *
    SyntaxError: invalid syntax


    I could really use some step by step help on this!

    Continue reading...

Compartilhe esta Página