Re: [tuxdroid-user] Daemon to USB connection
Status: Beta
Brought to you by:
ks156
From: Vincent F. <vin...@gm...> - 2007-06-13 17:43:26
|
2007/6/10, neimad <ror...@gm...>:> > 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 |