2007/6/10, neimad <[EMAIL PROTECTED]>:>
> On the Python side, sending data to a C program that expects structs
> can be achieved by the use of marshaling. I'm not aware of the latest
> and greatest ways to do this in Python, but 10+ years ago there were
> already such facilities, so I guess it must be possible and even
> easier today ;-)

Hi!
You can create struct in python with pack. See an example in the
nfsapp python version (a script you put on your S60 phone or other
which work with p3nfs (http://www.koeniglich.de/p3nfs.html)) :
http://amalfi.dis.unina.it/~foggia/nfsapp.py
Here is the example:

from struct import pack, unpack
msg = pack('<HBBLL', subdirs, flags, pad, size, mtime)
< means little-endian
H:unsigned short;
B:unsigned byte;
L:unsigned long;

for more information:
import struct
help(struct)

I hope it will be useful to you.
Vincent Fretin

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
tux-droid-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-user

Reply via email to