From 7e4dfbf8cd90d4ff98816eef40069be214dd266f Mon Sep 17 00:00:00 2001 From: Michal Tuszowski Date: Sat, 20 Jul 2024 09:00:51 +0200 Subject: [PATCH] NEw util --- conjurer_librarian/count_lines.py | 8 ++++++++ conjurer_librarian/search_bot.py | 1 + 2 files changed, 9 insertions(+) create mode 100644 conjurer_librarian/count_lines.py diff --git a/conjurer_librarian/count_lines.py b/conjurer_librarian/count_lines.py new file mode 100644 index 0000000..ab03c9d --- /dev/null +++ b/conjurer_librarian/count_lines.py @@ -0,0 +1,8 @@ + +FILEPTH = r"C:\Database\chunks\4_chunk.txt" + +with open(FILEPTH, "r", encoding="utf-8") as file: + tab = file.readlines() + print(len(tab)) + + #1842295 \ No newline at end of file diff --git a/conjurer_librarian/search_bot.py b/conjurer_librarian/search_bot.py index c310c4b..7a2ccaf 100644 --- a/conjurer_librarian/search_bot.py +++ b/conjurer_librarian/search_bot.py @@ -23,6 +23,7 @@ from queue import Empty, Queue from threading import Thread import time q = Queue() +#TODO: Count number of lines in files and print to approximate on which part of the file search is # DATA FOR TEST ONLY # MAXTHREADS = 5