From 5e8858deb6d62f168f99c63814d5200f6656c3b3 Mon Sep 17 00:00:00 2001 From: Lion Date: Tue, 12 Jul 2022 10:40:17 +0800 Subject: [PATCH] stdlize the result print --- binding/python/bench_test.py | 4 ++-- binding/python/search_test.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/binding/python/bench_test.py b/binding/python/bench_test.py index be5469f..7d6aa4f 100644 --- a/binding/python/bench_test.py +++ b/binding/python/bench_test.py @@ -5,7 +5,7 @@ # Created by luckydog on 2022/7/1. # Copyright © 2022年 luckydog. All rights reserved. # -from ast import main +# from ast import main import io from xdbSearcher import XdbSearcher @@ -101,7 +101,7 @@ def start_bench(dbFile="", srcFile="", cachePolicy="vectorIndex"): # close the searcher at last f.close() searcher.close() - print(f"Bench finished, [cachePolicy: {cachePolicy}, total: {count}, took: {round(time.time() - sTime, 2)} s, cost: {round(costs/count*1000, 4)} ms/op]") + print(f"Bench finished, {{cachePolicy: {cachePolicy}, total: {count}, took: {round(time.time() - sTime, 2)} s, cost: {round(costs/count*1000, 4)} ms/op}}") except Exception as err: print(f"failed to open source text file :{err}") return diff --git a/binding/python/search_test.py b/binding/python/search_test.py index 12a316a..c3adca8 100644 --- a/binding/python/search_test.py +++ b/binding/python/search_test.py @@ -77,7 +77,7 @@ def start_search(dbFile="", cachePolicy="vectorIndex"): print(error) return - print(f"region :{region_str} , took {round((time.time()-start)*1000.00, 4)} ms") + print(f"{{region: {region_str} , took: {round((time.time()-start)*1000.00, 4)} ms}}") # quit searcher.close() print("searcher test program exited, thanks for trying")