defcall(name): if name == 'left': return turtle.left else: return turtle.right
defkoch(n, length): if n==0: turtle.forward(length) else: for DA in DirectionAangle: koch(n-1,length/Division) call(DA[0])(DA[1]) koch(n-1,length/Division) koch(n=4, length=400) turtle.done()
AttributeError:
module 'numpy' has no attribute 'float'.
直接运行程序时,会提示:
1 2 3 4
AttributeError: module 'numpy' has no attribute 'float'. `np.float` was a deprecated aliasfor the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here. The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations. Did you mean: 'float16'?
于是根据提示:将np.float修改为np.float64解决问题。
ImportError:
libtk8.6.so: cannot open shared object file: No such file or
directory