The other day I released PyBindGen 0.8. Main news is that it features a new
experimental header file scanner based on pygccxml (i.e., it's similar to
py++ in scope, if not in maturity, but does not use boost.pythonunderneath).
== What ==
PyBindGen is a Python module that is geared to generating C/C++ code that
binds a C/C++ library for Python. It does so without extensive use of either
C++ templates or C pre-processor macros. It has modular handling of C/C++
types, and can be easily extended …
[View More]with Python plugins. The generated code is
almost as clean as what a human programmer would write, and does not depend
on any library or header files besides Python itself.
== Where ==
https://launchpad.net/pybindgen/
== NEWS ==
- Support C++ instance attributes through getter/setter methods
- Support functions as methods of C++ classes
- Support the PyObject* type
- Support unsigned int, C strings (char*) (from Mark Lee)
- Add basic support for enum types
- New experimental automatic module generator based on C/C++
header file scanner and annotations in comments, using pygccxml
- Some bug fixes
--
Gustavo J. A. M. Carneiro
INESC Porto, Telecommunications and Multimedia Unit
"The universe is always one step beyond logic." -- Frank Herbert
[View Less]
I'm the author of an extension module (blist) that provides a type that fits
the MutableSequence API. Is there a canonical way for me to register the
type as a MutableSequence from the C API?
--
Daniel Stutzbach, Ph.D.
President, Stutzbach Enterprises, LLC <http://stutzbachenterprises.com>
Hi,
if you want to write and run C code in Python IDE with auto-completion
if you want to introspect into C functions and data structs
if you hate the {} and ; and the DOS window (console)
Please take a look at:
http://pythoidc.googlecode.com
PythoidC is the C language like the Python, by the Python and for the Python
import c
c.include(c.h.stdio)
c.include(c.h.stdlib)
'''Annotation is free!'''
int fib(int n):
if(n<=2):
return1
else:
return fib(n-1)+ fib(n-…
[View More]2)
int main(int argc,char**argv):
int n //C style annotation
n=c.stdlib.atoi(argv[1])
c.stdio.printf('fibonacci(%d)=%d\n', n, fib(n))
[View Less]
"Goudar, Girish" <Girish.Goudar(a)goodrich.com> writes:
> Thanks for the quick reply. I can use the struct module at Python side
> and use the pack() function to pack the data. But in the DEOS side I
> need to unpack the data for that I need to use unpack() function. But
> DEOS is not supporting unpack() function. What to do?
I meant to use that you can use struct.pack to create data that can be
interpreted as a structure defined in C, assuming the same architecture
is run …
[View More]on both machines. Such sharing of data is one of the use cases
of the struct module. For example:
# python side:
import struct
s = struct.pack('cid', 'A', 10, 20.0)
send_data_to_network(s)
/* C side: */
struct data_desc {
char c;
int i;
double d;
};
char *s;
struct data_desc data;
s = read_data_from_network();
memcpy(&data, s, sizeof(data));
/* data.c is now the char
data.i the int
data.d the float (double) */
[View Less]