You are not logged in.

#1 2011-06-27 14:32:46

anirudh215
Member
Registered: 2011-03-07
Posts: 78

Cython

I'm trying to learn Cython. I have just installed the necessary files from the repos.

[1] SOLVED: When I gcc the c file that is generated by cython, I get an error,

fatal error: Python.h: No file or directory
Compilation terminated.

What do I do? I find Python.h resides in /usr/include/Python2.7. How do I tell gcc this?

[2] Does anyone know any good tutorials for cython besides those on the official website?

Last edited by anirudh215 (2011-06-27 14:37:31)

Offline

#2 2011-06-27 14:34:28

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: Cython

note that Arch uses python3 by default. you might have to point it to python2 in order to get it working.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#3 2011-06-27 14:36:33

anirudh215
Member
Registered: 2011-03-07
Posts: 78

Re: Cython

Okay. That's resolved. I've edited the original post. Only above question [2] left.

Offline

#4 2011-06-27 14:38:35

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: Cython

anirudh215 wrote:

I've edited the original post.

No. Don't do that !!

The replies in the thread look out of place and makes the thread look half-assed. Please do not edit your posts in that manner.



EDIT : Great now you edited and put back the 1st question -- making this reply look out of place.

Geez !! Anyway, moving along.

Last edited by Inxsible (2011-06-27 14:39:52)


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#5 2011-06-28 05:47:07

anirudh215
Member
Registered: 2011-03-07
Posts: 78

Re: Cython

Haha. When I began to edit the first post, you hadn't posted as yet. When I was done, I saw your reply, and then told myself the same thing you did, BEFORE you did. smile

Offline

#6 2011-06-28 18:43:35

whitie
Member
Registered: 2011-03-13
Posts: 23

Re: Cython

Offline

#7 2011-06-29 16:40:09

tavianator
Member
From: Waterloo, ON, Canada
Registered: 2007-08-21
Posts: 859
Website

Re: Cython

Inxsible wrote:

note that Arch uses python3 by default. you might have to point it to python2 in order to get it working.

Cython can generate python 2 or 3 code, regardless of whether it's run on python 2 or 3.

@OP: If you're looking for an example, here's a Cython binding for my C raytracer I'm writing: http://gitorious.org/dimension/dimensio … ension.pyx

Offline

#8 2011-06-30 17:15:29

anirudh215
Member
Registered: 2011-03-07
Posts: 78

Re: Cython

Thanks tavianator!

Offline

Board footer

Powered by FluxBB