From ba617efa747e1bc8ac224c83d243b746fad041b9 Mon Sep 17 00:00:00 2001 From: buladou Date: Wed, 24 Aug 2022 21:15:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dtest=5Fexcel.py=E7=9A=84?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- office/api/excel.py | 3 ++- tests/test_excel.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/office/api/excel.py b/office/api/excel.py index e08aac8..45691eb 100644 --- a/office/api/excel.py +++ b/office/api/excel.py @@ -40,4 +40,5 @@ def sheet2excel(file_path): # 搜索excel中指定内容的文件、行数、内容详情 # @except_dec() def find_excel_data(search_key: str, target_dir: str): - mainExcel.find_excel_data(search_key, target_dir) + return mainExcel.find_excel_data(search_key, target_dir) + diff --git a/tests/test_excel.py b/tests/test_excel.py index 23a074e..705c925 100644 --- a/tests/test_excel.py +++ b/tests/test_excel.py @@ -27,4 +27,5 @@ class TestExcel(unittest.TestCase): ) def test_find_excel_data(self): - find_excel_data(search_key='刘家站垦殖场', target_dir=r'D:\workplace\code\gitee\python-office\contributors\bulabean') + for data in find_excel_data(search_key='刘家站垦殖场', target_dir=r'C:\Users\kelly\workspace\python-office\contributors\bulabean'): + print(data) -- Gitee