##########测试环境EPD7.0.2 from scipy.weave import inline from scipy.weave import converters def test(): x=list(range(10)) code = """ int i; for (i=0; i < 10; i++) { x[i] = 1; } """ inline(code, ["x"],type_converters=converters.blitz,compiler = 'gcc') return x x=test() print x ####输出信息######################## #Found executable C:/Python27/Scripts/g++.exe #[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] ####输出信息########################
简单使用scipy.weave混合使用Python和C++代码的简单例子
最新推荐文章于 2024-06-29 11:36:17 发布