473,386 Members | 1,736 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

pyrex problem

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
1 1056
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Gary Stephenson | last post by:
I'm getting a clean generate, compile and link from my .pyx script, but when I attempt to run the resultant .exe, I get: "The procedure entry point Py_NoneStruct could not be located in the...
10
by: Kyler Laird | last post by:
I need to submit C/C++ code for a class. (It's not a programming class. The choice of language is inertial. I think that it mostly serves to distract students from the course subject.) I'm...
0
by: Pawel Oleksik | last post by:
Hi, I have no idea, how to properly declare/use Numeric functions in pyrex. For example the code below causes segmentation fault: --in pyrex-------------- cdef extern from...
4
by: Kyler Laird | last post by:
I mentioned earlier that I started using Pyrex because I'm taking a computer vision course that requires all assignments to be submitted as C(++). While I could write C it would hurt me to do so...
1
by: Martin Bless | last post by:
Now that I've got my extension building machine using the VC++ Toolkit 2003 up and running I'm keen on using Pyrex (Pyrex-0.9.3, Python-2.4.0). But the definition of the swig_sources() method...
27
by: Julien Fiore | last post by:
Do you wand to install Pyrex on Windows ? Here is a step-by-step guide explaining: A) how to install Pyrex on Windows XP. B) how to compile a Pyrex module. Julien Fiore, U. of Geneva
11
by: Jim Lewis | last post by:
Has anyone found a good link on exactly how to speed up code using pyrex? I found various info but the focus is usually not on code speedup.
7
by: Jim Lewis | last post by:
I'm trying to move a function into pyrex for speed. The python side needs to pass a list to the pyrex function. Do I need to convert to array or something so pyrex can generate tight code? I'm not...
1
by: Hans Terlouw | last post by:
Hi, When trying to wrap C code using Pyrex, I encountered a strange problem with a piece of pure Python code. I tried to isolate the problem. The following code causes Pyrex to generate C code...
3
by: skip | last post by:
I'm using Pyrex 0.9.5.1a. I have this simple Pyrex module: cdef class Foo: cdef public char attr def __init__(self): self.attr = 0 class Bar(Foo): def __init__(self):
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.