Skip to content

Tag: cython

Getting started with cython on mac os

I wrote a simple program in python: Then I execute this: It was generated a file: main.c And then I tried this: And I have an error: How to compile python to c ? How to get started with cython with xcode on mac ? Answer You have to tell the gcc compiler where is the pyconfig.h file on your

Correct way to generate random numbers in Cython?

What is the most efficient and portable way to generate a random random in [0,1] in Cython? One approach is to use INT_MAX and rand() from the C library: Is it OK to use INT_MAX in this way? I noticed that it’s quite different from the constant you get from Python’s max int: yields: Which is the r…