On Apr 18, 2:25 pm, KoolD <sourya...@gmail.com> wrote: > Hey all, > I need to convert a C code to python please help me figure out how to > do > it. > Suppose the C program's like: > > ------------------------------------ > typedef struct _str > { > int a; > char *b; > int c;}str; > > int main() > { > str mbr; > fd=open("/dev/sda",O_RDONLY); > read(fd,&mbr,sizeof(str));} > > ------------------------------------ > > Is there a way to code it in python. > > Thanks > Sourya
There is the 'ctypes' module, but you might also need 'mmap', for the 'read( &mbr )' operation. -- http://mail.python.org/mailman/listinfo/python-list