http://www.geocities.jp/penguinitis2002/computer/programming/Python/cython/cython.html
このサイトを参考にcythonのサンプルを動かそうとしています
サンプルコードは以下の通りです
ここで、
python setup.py build_ext --inplace
と実行すると
python
1cythonfn.pyx 2 3def calculate_z(maxiter, zs, cs): 4 """Calculate output list using Julia update rule""" 5 output = [0] * len(zs) 6 for i in range(len(zs)): 7 n = 0 8 z = zs[i] 9 c = cs[i] 10 while n < maxiter and abs(z) < 2: 11 z = z * z + c 12 n += 1 13 output[i] = n 14 return output 15-------------------------------------------------------------- 16setup.py 17 18from distutils.core import setup 19from distutils.extension import Extension 20from Cython.Distutils import build_ext 21 22# for notes on compiler flags e.g. using 23# export CFLAGS=-O2 24# so gcc has -O2 passed (even though it doesn't make the code faster!) 25# http://docs.python.org/install/index.html 26 27setup( 28 cmdclass={'build_ext': build_ext}, 29 ext_modules=[Extension("calculate", ["cythonfn.pyx"])] 30---------------------------------------------------------------- 31実行結果 32 33Traceback (most recent call last): 34 File "setup.py", line 12, in <module> 35 ext_modules=[Extension("calculate", ["cythonfn.pyx"])] 36File… 37File… 38UnicodeDecodeError: 'cp932' codec can't decode byte 0xef in position 0: illegal multibyte sequence
このようになります
なにが原因でしょうか
おしえてください
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/07/11 09:55
2017/07/11 09:57
2017/07/11 10:00
2017/07/11 10:08
2017/07/11 10:17
2017/07/11 10:21
2017/07/11 10:26
2017/07/11 10:54
2017/07/11 10:59 編集
2017/07/11 11:13
2017/07/11 11:42
2017/07/11 12:04
2017/07/11 12:34
2017/07/11 12:43
2017/07/12 01:38
2017/07/12 01:44
2017/07/12 02:49
2017/07/12 02:49
2017/07/12 02:50
2017/07/12 02:55
2017/07/12 03:08
2017/07/12 03:37
2017/07/12 03:45