简单使用scipy.weave混合使用Python和C++代码的简单例子
##########测试环境EPD7.0.2from scipy.weave import inline from scipy.weave import convertersdef test():x=list(range(10))code = """ int i; for (i=0; i < 10; i++) { x = 1; } """ inline(code, ["x"],type_converters=converters.blitz,compiler = 'gcc') return x x=test() print x####输出信息#########################Found executable C:/Python27/Scripts/g++.exe#####输出信息########################
页:
[1]