diff --git a/pdf_table_extraction_and_ocr.org b/pdf_table_extraction_and_ocr.org
index dba995a..7ad322f 100644
--- a/pdf_table_extraction_and_ocr.org
+++ b/pdf_table_extraction_and_ocr.org
@@ -905,15 +905,15 @@ def main(files):
cv2.imwrite(table_filepath, table)
if tables:
results.append((f, files))
-
- for image_filename, table_filenames in results:
- print("\n".join(table_filenames))
-
+ # Results is [[, []]]
+ return results
if __name__ == "__main__":
args = parser.parse_args()
files = args.files
- main(files)
+ results = main(files)
+ for image, tables in results:
+ print("\n".join(tables))
#+END_SRC
*** table_ocr/extract_cells/
diff --git a/table_ocr/extract_tables/__main__.py b/table_ocr/extract_tables/__main__.py
index b7ec6f1..69aaa22 100644
--- a/table_ocr/extract_tables/__main__.py
+++ b/table_ocr/extract_tables/__main__.py
@@ -28,12 +28,12 @@ def main(files):
cv2.imwrite(table_filepath, table)
if tables:
results.append((f, files))
-
- for image_filename, table_filenames in results:
- print("\n".join(table_filenames))
-
+ # Results is [[, []]]
+ return results
if __name__ == "__main__":
args = parser.parse_args()
files = args.files
- main(files)
+ results = main(files)
+ for image, tables in results:
+ print("\n".join(tables))