关于您的错误:
The error was: 1st arg can't be coerced to int
Inappropriate argument type.
An attempt was made to call a function with a parameter of an invalid type.
This means that you did something such as trying to pass a string to a method
that is expecting an integer.
这是因为 range()
功能需求 integers
作为参数。
当你这样做的时候 rheight = height*0.4
, , 作为 0.4
是浮点数,python/jython解释器也将“高度*0.4”计算为浮点。导致“ Rheight”是浮标。
使固定: 你必须明确 cast
作为整数的价值:
rheight = int(height*0.4)