Re: C function in a Python context

2008-02-19 Thread castironpi
#include string #include vector This modification required: compilercommand='c:/programs/mingw/bin/g++' and strctypes= { 'i': 'int', 's': 'const char*', 'O': 'PyObject*' } The output is: #include c:/programs/python/include/Python.h [ user code ] static PyObject *

Re: C function in a Python context

2008-02-12 Thread castironpi
On Feb 9, 3:04 pm, [EMAIL PROTECTED] wrote: On Feb 9, 1:48 pm, [EMAIL PROTECTED] wrote: To write quick C things that Python won't do up to speed.  So it's got a redundancy. import ext extA= ext.Ext() extA[ 'enumfactors' ]= r     int enumfactors( int a, const char* sep ) {      

C function in a Python context

2008-02-09 Thread castironpi
To write quick C things that Python won't do up to speed. So it's got a redundancy. import ext extA= ext.Ext() extA[ 'enumfactors' ]= r int enumfactors( int a, const char* sep ) { int ret= 0, i; for( i= 1; i= a; i++ ) { if( a% i== 0 ) { ret+= 1;

Re: C function in a Python context

2008-02-09 Thread castironpi
On Feb 9, 1:48 pm, [EMAIL PROTECTED] wrote: To write quick C things that Python won't do up to speed.  So it's got a redundancy. import ext extA= ext.Ext() extA[ 'enumfactors' ]= r     int enumfactors( int a, const char* sep ) {         int ret= 0, i;         for( i= 1; i= a; i++ ) {