Skip to content

Commit 6df66f2

Browse files
committed
Adding Support For Windows Machines
1 parent 531eaa0 commit 6df66f2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

search.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
23
import argparse
34
import sys
45
import re
@@ -67,15 +68,15 @@ def main():
6768
tqdm.write("Found {} files to search. Please wait.".
6869
format(len(all_txt_files)))
6970

70-
with open(csv_file_name, 'a+', encoding="utf-8") as f:
71+
with open(csv_file_name, 'a+', encoding="utf-8-sig") as f:
7172
# Using dictionary keys as fieldnames for the CSV file header
7273
writer = csv.DictWriter(f, headers)
7374
writer.writeheader()
7475
logger.info("CSV headers written")
7576

7677
for idx, txt_file in enumerate(all_txt_files):
7778

78-
with open(txt_file) as fp:
79+
with open(txt_file, "r", encoding="utf-8-sig") as fp:
7980
visible_text_list = fp.readlines()
8081
current_url = visible_text_list[0].strip().rstrip()
8182
num_digits = len(str(len(all_txt_files)))

0 commit comments

Comments
 (0)