4 ms·
Embedding C or C++ into python is no big deal with scipy.weave and gcc. Just try it: http://albert.rierol.net/doodle_programming.html#1 http://albert.rierol.ne
by albertcardona 18y ago
Embedding C or C++ into python is no big deal with scipy.weave and gcc. Just try it:
http://albert.rierol.net/doodle_programming.html#1 http://albert.rierol.net/doodle_programming.html#1
- CUViper 18y agoThanks -- scipy.weave looks to do the trick! BTW, while that linked code is a good example of how weave works, it's a bad example of when to use it. I've no doubt that the code runs faster with that portion written in C, but a different algorithm could blow it away. A prime generator like that would be MUCH faster with a sieve, even in pure Python.
- albertcardona 18y agoThat code was proof of principle, just playing. No claim to have written any particularly efficient prime number generator. I'm glad you found it instructive.