Skip to content

Commit c046dc4

Browse files
Update document_scanner.py
1 parent 16b0998 commit c046dc4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

backend/document_scanner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def __init__(self):
3333
def extract_text(self, input_file, output_text):
3434
doc = docx.Document(input_file)
3535
name = os.path.basename(os.path.normpath(input_file)).split(".")[0]
36-
with open(name + "_" + output_text + ".txt", "w" ,encoding = "utf-8") as file:
36+
with open(os.path.join(os.path.extenduser("~"), "ShellPrivacyFilterDemo", "data", name + "_" + output_text + ".txt"), "w", encoding = "utf-8") as file:
3737
for para in doc.paragraphs:
3838
file.write(para.text + u"\n")
3939

@@ -44,7 +44,7 @@ def extract_images(self, input_file, output_img):
4444
if info.filename.endswith((".png", ".jpeg", ".gif")):
4545
doc.extract(info.filename, output_img)
4646
shutil.copy(os.path.join(output_img, info.filename),
47-
os.path.join(output_img,
47+
os.path.join(os.path.extenduser("~"), "ShellPrivacyFilterDemo", "data", output_img,
4848
name + "_" +
4949
os.path.basename(os.path.normpath(info.filename))))
5050
self.images.append(name + "_" +

0 commit comments

Comments
 (0)