pyrex problem

B

borges2003xx

hi everyone
i'm newbie

i try to compile the pyrex module:
def controlla(char *test):
cdef int limitem,lunghezz,li,l2,f,ii,kk
cdef char *t1
cdef char *t2
limitem=4
lunghezz=len(test)
l1=lunghezz-limitem+1
l2=lunghezz-limitem+1
f=0
for ii from 0 <= ii < l1-1:
for kk from 0 <= kk < l2-1:
t1=test[ii:ii+limitem]
t2=test[kk:kk+limitem]

if (ii<>kk):
if t1==t2:
f=1
if f==1:
break
if f==0:
return test
else:
return 'no'


but i receive the error:
obtaining char * from temporary python value

what happens?
thanx everyone
sorry for silly question.

giorgio borghi
 
A

Andreas Kostyrka

hi everyone
i'm newbie

i try to compile the pyrex module:
def controlla(char *test):
You cannot have a C datatype in a Python like that.
Much better to use def controlla(test):

Andreas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top