它在告诉你
x
这是一根绳子。它来自
boxes
text_boxes
. 您不能使用以下方式解压缩字典值:
(x, y, w, h) = box
x = box["x"]
y = box["y"]
w = box["w"]
h = box["h"]
另一个选择是:
def _find_table_in_box(cell_threshold, x, y, w, h):
print(x, y, w, h)
col_key = x // cell_threshold
def find_table_in_boxes(boxes, cell_threshold=10, min_columns=2):
for box in boxes:
_find_table_in_box(cell_threshold, **box)