By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,095 Members | 1,586 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,095 IT Pros & Developers. It's quick & easy.

pyrex problem

P: n/a
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

Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Fri, Jun 17, 2005 at 01:03:14AM -0700, bo**********@yahoo.it wrote:
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
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.