[python-win32] Passing c structure into Python script

Gerdus van Zyl gerdusvanzyl at gmail.com
Thu Nov 19 12:46:09 CET 2009


Never done it myself but I would suggest writing the c struct to a temp file.

Then call the python script using normal system call in C
(http://en.wikipedia.org/wiki/System_%28C_standard_library%29)
and read the temp file using struct module from python
http://docs.python.org/library/struct.html

Maybe somebody else has code snippet they can share? or better approach.

On Thu, Nov 19, 2009 at 9:58 AM, a h <ah.kode at gmail.com> wrote:
> Hi all
>
> I want to know that how do I pass an C structure into python script.
> Actually my problem is
> 1. how do I call python script from C application ,in which I can pass C
> structure
> 2. how do I take that C structure into an python script
>
> actually i have to write an python script which take an C structure and
> using pyasn, it encode that structure and dump the encoded data.
> also please provide some code snippets.
>
> Thanks
> ah
> _______________________________________________
> python-win32 mailing list
> python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32
>
>


More information about the python-win32 mailing list