我是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
我在ubuntu12.04中用wine和VIDLE VPython运行这个。在
如果我从Ubuntu本地运行这段代码,它仍然不能执行,但是错误消息是不同的:
^{pr2}$由于我不太熟悉Python编程和错误消息,我有点迷茫了,不知道从哪里开始寻找错误的根源。在
目前没有回答
相关问题 更多 >
编程相关推荐