私は Python の初心者で、次のコードを実行しようとしています: http://www.physics.orst.edu/~rubin/Books/eBookWorking/html/Ising.html
このコードを実行しようとすると、次のエラーが発生します。
Traceback (most recent call last):
File "C:\simulations\ising\ising.py", line 53
spstate(state) # plots initial state: all spins down
File "C:\simulations\ising\ising.py", line 47, in spstate
arrow(pos=(i,ypos,0), axis=(0,5*state[j],0), color=arrowcol)
NameError: global name 'arrow' is not defined
奇妙なのは、矢印が VPython の関数であると想定されているためです: http://www.vpython.org/contents/docs/arrow.html
VIDLE VPythonを使用して、ワインの下でUbuntu 12.04でこれを実行しています。
このコードを Ubuntu からネイティブに実行すると、まだ実行されませんが、エラー メッセージは異なります。
(python:12493): GdkGLExt-WARNING **: Cannot open \u000c
(python:12493): GdkGLExt-WARNING **: Cannot open \xa0\xbc\u0005X\x8a\u007f
(python:12493): glibmm-ERROR **:
unhandled exception (type std::exception) in signal handler:
what: Unable to get extension function: glCreateProgramObjectARB even though the extension is advertised.
Trace/breakpoint trap (core dumped)
私は Python プログラミングとエラー メッセージにあまり詳しくないので、どこからエラーの原因を探せばよいのかわかりません。