Re: [python-win32] passing c structure into python function [SEC=PERSONAL]

2010-02-15 Thread Andrew MacIntyre
> On Behalf Of Tim Roberts > > a h wrote: > > > > thnks. i have used struct.unpack function for small c structure as the > > way Tim has suggested. > > i have an complex C structure, and passing this structure as a string > > and then using struct.unpack() is very tough job.and also i have > > poi

Re: [python-win32] passing c structure into python function

2010-02-15 Thread Tim Roberts
a h wrote: > > thnks. i have used struct.unpack function for small c structure as the > way Tim has suggested. > i have an complex C structure, and passing this structure as a string > and then using struct.unpack() is very tough job.and also i have > pointers in my struct now. > > i want that i

Re: [python-win32] passing c structure into python function

2010-02-15 Thread a h
Hi thnks. i have used struct.unpack function for small c structure as the way Tim has suggested. i have an complex C structure, and passing this structure as a string and then using struct.unpack() is very tough job.and also i have pointers in my struct now. i want that i have structure say like s

Re: [python-win32] passing c structure into python function

2010-01-13 Thread Tim Roberts
a h wrote: > > thanks for your response > in the last piece of c code i want to know how do i pass structure > into python function in c. I have tried to call a python function > which takes string as parameter. > > i have passed string parameter as : > const char *str_pArgs = "hello"; > pArgs =

Re: [python-win32] passing c structure into python function

2010-01-13 Thread a h
Hi thanks for your response in the last piece of c code i want to know how do i pass structure into python function in c. I have tried to call a python function which takes string as parameter. i have passed string parameter as : const char *str_pArgs = "hello"; pArgs = PyTuple_New(1); pValue = Py

Re: [python-win32] passing c structure into python function

2010-01-12 Thread Tim Roberts
Aahz wrote: > On Tue, Jan 12, 2010, Tim Roberts wrote: > >> I would pass the struct as a string of 14 bytes, then use >> emp_name, emp_ID = struct.unpack( '=10cI', incoming ) >> >> class employee: >> def __init__( self, name, id ): >> self.name = name >> self.id = id >>

Re: [python-win32] passing c structure into python function

2010-01-12 Thread Aahz
On Tue, Jan 12, 2010, Tim Roberts wrote: > > I would pass the struct as a string of 14 bytes, then use > emp_name, emp_ID = struct.unpack( '=10cI', incoming ) > > class employee: > def __init__( self, name, id ): > self.name = name > self.id = id > def to_file( self, f

Re: [python-win32] passing c structure into python function

2010-01-12 Thread Tim Roberts
a h wrote: > > I have witten C code which call a function defined in python, passing > an structure, but couldn't know how to pass c structure into a python > function(data conversion) and how to write python script > function which takes an c structure and fill value into it (commented > portion)

[python-win32] passing c structure into python function

2010-01-12 Thread a h
Hi I have witten C code which call a function defined in python, passing an structure, but couldn't know how to pass c structure into a python function(data conversion) and how to write python script function which takes an c structure and fill value into it (commented portion) I have looked at st