TypeError: slice indices must be integers or None or have an __index__ method
程序员文章站
2022-07-15 11:08:38
...
start_width = (width_large - width_small) / 2
start_height = (height_large - height_small) / 2
img_large[start_height:start_height + height_small,
start_width:start_width + width_small] = img_small
TypeError: slice indices must be integers or None or have an __index__ method
这里最后一句切片的时候报错!
推荐阅读
-
TypeError: slice indices must be integers or None or have an __index__ method
-
TypeError: slice indices must be integers or None or have an __index__ method解决方法
-
TypeError: slice indices must be integers or None or have an __index__ method原因分析及解决办法
-
TypeError: slice indices must be integers or None or have an __index__ method原因分析及解决办法