我是Cython的新手所以请耐心等待 在Windows上将Python代码编译为Cython时,EPC_test.pyd生成正常 但是在导入EPC_test时,我收到了一个NameError。
EPC_test.pyx(代码段)
persps = ['GU','GR','RL']
for persp in persps:
#filter list by perspective
arr_persp = rows[rows[:,1]==persp]
..
>>> import EPC_test
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "EPC_test.pyx", line 1191, in init EPC_test (EPC_test.c:23097)
for persp in persps:
NameError: name 'persps' is not defined
我需要在某处cdef persps
吗?据我所知,所有python代码都不需要任何C定义,应该直接编译。请指教