Re: C function in a Python context

2008-02-19 Thread castironpi
> #include > #include This modification required: compilercommand='c:/programs/mingw/bin/g++' and strctypes= { 'i': 'int', 's': 'const char*', 'O': 'PyObject*' } The output is: #include [ user code ] static PyObject * extcode_enumfactors(PyObject *self, PyObject *args) {

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

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;

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;