extending and embedding python to pass structure to functionyou must create an instance of the structure or union to do thisyou call previous defined structure or union type structuretype as followsstructuretype(*args**kwargscreates an instance of structuretype where structuretype is class derived from structure or union positional arguments in *args are used to initialize the structure members in the same order as they are listed in _fields_ keyword arguments in **kwargs initialize just the named structure members alternative type construction methods all instances of ctypes types such as c_intpointerand so forth have some class methods that are used to create instances of ctypes types from memory locations and other objects ty from_buffer(source [,offset]creates an instance of ctypes type ty that shares the same memory buffer as source source must be any other object that supports the writable buffer interface ( bytearrayarray objects in the array modulemmapand so onoffset is the number of bytes from the start of the buffer to use ty from_buffer_copy(source [offset]the same as ty from_buffer(except that copy of the memory is made and that source can be read-only ty from_address(addresscreates an instance of ctypes type ty from raw memory address address specified as an integer ty from_param(objcreates an instance of ctypes type ty from python object obj this only works if the passed object obj can be adapted into the appropriate type for examplea python integer can be adapted into c_int instance ty in_dll(librarynamecreates an instance of ctypes type ty from symbol in shared library library is an instance of the loaded library such as the object created by the cdll class name is the name of symbol this method can be used to put ctypes wrapper around global variables defined in library the following example shows how you might create reference to global variable int status defined in library libexample so libexample ctypes cdll("libexample so"status ctypes c_int in_dll(libexample,"status" lib fl ff